Click here to Skip to main content
15,910,471 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Please help me how to create this string in asp.net class file using array:
Update table set name=@name,add=@add,date=@date
and how to call in asp.net page
Posted
Comments
Sandeep Mewara 17-May-11 3:03am    
Array string? looks like you are trying to make a sql query but you say array string.

See my answer to your previous question on the same topic 5 minutes ago, and stop posting the same question - it is very rude.
 
Share this answer
 
Rahul,

Why you want to create this string, are you using parameters (parameterize query)?

You can loop through array and form the string, and join it with "Update Table" query.

Like you have Parameters[] then you can loop through each parameter and form string line "name=@name, add=@add, date=@date ..."

Regards
Rushi
 
Share this answer
 
Try

string query = "Update table set name='"+ NameValue +"',add= '"+ addValue +"',date= '"+ dateValue +"'";


If the datatype is text or varchar or datetime use single quote else remove them
 
Share this answer
 
Comments
rahul dev123 17-May-11 3:27am    
I want to write query in only one time....In your code if we required one more columns then again we are need to create different query.

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