Click here to Skip to main content
15,892,575 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi friends

i have 5 columns,each column have one control if i click the control its show the property window and set all properties for all control finally save the 5 control information to database. my questions is how to store the five control in db. using array or hidden into save button. give me one sample example. please its very urgent. help me.
Posted

Hello Keerthana,

You can send the information to the database in the following ways,
1. comma seperated string
2. As an xml type
3. As a table type

google the above ways you can find many examples in online.
let me know found any difficulty. Happy coding :)
 
Share this answer
 
Comments
keerthana.k 31-Jan-13 1:10am    
give me some examples
first of all you can store the total information in one DataTable/DataSet then using foreach you can do this stuff. Inside foreach you write your inserting query...

ex:

C#
DataTable dt=/// your data;
foreach ( DataRow dr in dt.Rows)
{
    //inserting query..
}


check with this links

http://blogs.msdn.com/b/nikhilsi/archive/2008/06/11/bulk-insert-into-sql-from-c-app.aspx[^]
http://www.jarloo.com/c-bulk-upsert-to-sql-server-tutorial/[^]
 
Share this answer
 
v2
Comments
keerthana.k 31-Jan-13 1:10am    
give me some examples
it's better to use a collection which holds both key and value pairs
I mean to use Hashtable to store all the properties from 5 controls. While you are doing any activity (moving from one control to another control) save your details in hashtable.
After that prepare a query based on the values you collected in hashtable and submit your insert or update query to DB server.

once your query executed remove the memory from hashtable or clear the records.

Hope it helps you.. Let us know if you need more into
 
Share this answer
 
Comments
keerthana.k 31-Jan-13 1:09am    
give some examp[les

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