S
Selen
Hello,
My problem is that I want to show data in datagrid from two table.I have two
table tb_Eqp_Main and tb_Equipment they have a relationship with EqpNo...
I use da.Fill(dataset,Table name) but I dont know What must I write to
TableName...My code :
strConn="server=(local)\\sql2000;database=db_Kalite_Data;uid=sa;pwd=antalya"
;
SqlConnection conn=new SqlConnection (strConn);
conn.Open ();
string strCmd="select M.EqpNo,M.SerialNumber ,M.Description,Eqp.Tip" +
",Eqp.NextCalibration,Eqp.NextBakim,Eqp.NextSafety,M.Location,tip.TypeName "
+
" from tb_Eqp_Main as M ,tb_Equipment Eqp" +
", tb_Eqp_Type tip where tip.TypeId=Eqp.Description and M.EqpNo=M.EqpNo" ;
SqlCommand cmd=new SqlCommand (strCmd,conn);
SqlDataReader dr=cmd.ExecuteReader ();
SqlDataAdapter da=new SqlDataAdapter (strCmd,conn);
DataSet ds=new DataSet ();
da.Fill (ds,"???????");
dgEqp.DataSource =ds;
dgEqp.DataBind ();
Thanks....
My problem is that I want to show data in datagrid from two table.I have two
table tb_Eqp_Main and tb_Equipment they have a relationship with EqpNo...
I use da.Fill(dataset,Table name) but I dont know What must I write to
TableName...My code :
strConn="server=(local)\\sql2000;database=db_Kalite_Data;uid=sa;pwd=antalya"
;
SqlConnection conn=new SqlConnection (strConn);
conn.Open ();
string strCmd="select M.EqpNo,M.SerialNumber ,M.Description,Eqp.Tip" +
",Eqp.NextCalibration,Eqp.NextBakim,Eqp.NextSafety,M.Location,tip.TypeName "
+
" from tb_Eqp_Main as M ,tb_Equipment Eqp" +
", tb_Eqp_Type tip where tip.TypeId=Eqp.Description and M.EqpNo=M.EqpNo" ;
SqlCommand cmd=new SqlCommand (strCmd,conn);
SqlDataReader dr=cmd.ExecuteReader ();
SqlDataAdapter da=new SqlDataAdapter (strCmd,conn);
DataSet ds=new DataSet ();
da.Fill (ds,"???????");
dgEqp.DataSource =ds;
dgEqp.DataBind ();
Thanks....