المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Database connectivity at runtime



C# Programming
05-18-2009, 09:43 AM
Hi friends, i got a problem with connecting data of controls to a database at runtime.

First, i wanted to create "n" number of textbox controls at runtime. And it was successful.
Secondly, i wanted to store content or data of the textboxes to my database, the problem is since the controls of Textbox are going to be created at runtime, how can i represent the value(data) of those textboxes at runtime ?

Example: if i need to create 3(n == 3)textboxes and wanted to store their data into my table.

Insert into table1 values(text1.text, text2.text, text3.text);

if( n == 5)
Insert into table1 values(text1.text, text2.text, text3.text, text4.text, text5.text);

Girmay