read data from sql
i have sql table like below
sno name mobile
1 raju 9014494876
2 vamshi 9346352389
i want o/p like below in csharp code
i have two texboxs
textbox1 ,textox2
i want read name from sql table display first text box read ""raju"' and second textbox "vamshi"
o/p ...
raju
vamshi
Loading
Ranjit PowarPosted Apr 19, 2014, 7:30 AM
SqlDataAdapter da;
DataSet ds;
da = new SqlDataAdapter("Select name from Tablename ", con);
da.SelectCommand.CommandType = CommandType.StoredProcedure;
ds = new DataSet();
da.Fill(ds);
textbox1 . Text = ds.Tables[0].Rows[0]["Name"].ToString();
textbox2 . Text = ds.Tables[0].Rows[1]["Name"].ToString();
Ranjit PowarPosted Apr 19, 2014, 8:22 AM
sama rrPosted Apr 19, 2014, 7:38 AM
if sql table like below
sno qunty rate
1 5 6
2 4 3.5
multiply coloum2 and coloum3
read
first textbox,second text box dispaly like ( qunty * rate )5*6= 30
o/p
30
14