Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hai,


I have some doubts in gridview during updating.Suppose we use ID column as a primary key in sql server.It means in our gridview coding during updating we write as
cmd.Parameters.Add("@ID",SqlDbType.Int).Value =Convert.ToInt32(GridView1.Rows[e.RowIndex].Cells[1].Text);


and for varchar
cmd.Parameters.Add("@NAME", SqlDbType.VarChar).Value = ((TextBox)GridView1.Rows[e.RowIndex].Cells[2].Controls[0]).Text;
.

My doubt is if we are using salary column in sql server database we have to use money.How can we do this coding in gridview during updation part.And also plz tell me for datetime datatype.
Posted

For Money take it in decimal or float and
for datetime you can take DateTime.MinValue.ToLongTimeString() or
DateTime.MaxValue.ToLongTimeString()
 
Share this answer
 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900