本文介绍了值不能为空。在C#WinApp中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在DataSet中创建一个表,它在一个水晶报表中显示多个表,其中一个值是我的代码: -
I Create One table in DataSet that it display Multiple Table in one crystal report with one value this is my code :-
public partial class FRM_RPT_CAR_ID : Form
{
int x;
SqlConnection con = new SqlConnection("Server= .; Database= WhiteWhaleDB; Integrated Security = true");
SqlCommand sd;
SqlDataReader sda;
string s;
public FRM_RPT_CAR_ID()
{
InitializeComponent();
}
public FRM_RPT_CAR_ID(string x)
{
InitializeComponent();
this.x = int.Parse(x);
}
private void FRM_RPT_CAR_ID_Load(object sender, EventArgs e)
{
s = "select s1.Car_id, s1.Change_date , Service_Type.Servce_desc,s1.Current_dist, s1.Prev_distance as Prev_dist, (s1.Current_dist - s1.Prev_dist) as Change_dist ,s1.value_Tashhem as Value from Tashhem s1 INNER JOIN Service_Type ON s1.Servce_id = Service_Type.Servce_id where s1.Car_id" + x;
DataSet1 ds = new DataSet1();
SqlDataAdapter dataAdapter = new SqlDataAdapter(s, con);
dataAdapter.Fill(ds.Tables["Car_details"]);
CrystalReport_Car_id report = new CrystalReport_Car_id();
report.SetDataSource(ds.Tables["Car_details"]);
crystalReportViewer_Car_id.ReportSource = report;
crystalReportViewer_Car_id.Refresh();
}
推荐答案
这篇关于值不能为空。在C#WinApp中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!