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

مشاهدة النسخة كاملة : insert records using parameters .



C++ Programming
05-19-2009, 08:00 PM
How do i insert a recordset where i take parameters from the user.

User enters his values in editboxes and when he hits "insert" button a query is fired

insert into table1 values (editboxvalue1, editboxvalue2 , editboxvalue3 , editboxvalue4 );

For this i can take values from editbox with the GetWindowText() method and store it in some variable .

but how should the query look like ,and should i use Connection::Execute() or Command::Execute() for this.

I have been using Connection::Execute( ) to Insert ,Update and Delete a recordset.

For queries with parameters which is a better choice ???

And how to form a insert query to insert values from user,into DB ???