Here's an example from an app I recently wrote:
OleDbCommand move1 = new OleDbCommand();
OleDbCommand delete1 = new OleDbCommand();
move1.CommandText = ("INSERT INTO Master ( Field1,
Field2 ) SELECT Field1, field2 FROM Table2 WHERE Field1 = '" +
Txtovers.Text.ToString() + "';");
delete1.CommandText = ("DELETE FROM Table2 WHERE
Field1 = '" + Txtovers.Text.ToString().Trim() + "';");
move1.Connection = con;
delete1.Connection = con;
con.Open();
move1.ExecuteNonQuery();
delete1.ExecuteNonQuery();
con.Close();
On Mar 29, 12:41 pm, aditya chavan <[email protected]> wrote:
> this select data from the table
> but i want data from textboxes should be inserted through table adapter in
> database
>
> On Mon, Mar 29, 2010 at 5:14 PM, Bernardo Rosmaninho <
>
> [email protected]> wrote:
> > SqlCeDataAdapter da = new SqlCeDataAdapter("SELECT * FROM TABLE",
> > "ConectionString");
>
> > 2010/3/29 aditya chavan <[email protected]>
>
> >> hello
>
> >> i have made smart device in which m using *.sdf file as a database.
>
> >> now in this i have created table adapter in the dataset and also made
> >> insert query command in table adapter
>
> >> but i dont how to use this insert query in table adapter in c# ..
> >> so can i geta smaple code how to add or write insert query ..?
>
> >> thank you...
>
> >> Aditya
>
> >> To unsubscribe from this group, send email to dotnetdevelopment+
> >> unsubscribegooglegroups.com or reply to this email with the words "REMOVE
> >> ME" as the subject.
>
> > --
> > Bernardo Rosmaninho
>
> > To unsubscribe from this group, send email to dotnetdevelopment+
> > unsubscribegooglegroups.com or reply to this email with the words "REMOVE
> > ME" as the subject.
--
To unsubscribe, reply using "remove me" as the subject.