Hi

I need to perform following querie in vb.net

The queries are;

NSERT INTO [destTbl] (field1, field2)
SELECT srcTbl.field1, srcTbl.field2
FROM srcTbl
WHERE (((srcTbl.entry_id) Not In (SELECT srcTbl.entry_id FROM [destTbl])));


In access I just run these query and job is done without any error in SQL
View. What is the easiest way to execute this querie in
ado.net/vb.net?


Thanks

Re: Help with INSERT statement. by W

W
Tue Jan 23 14:42:21 CST 2007

Create a command and connection object. Set the connection's
connectionString property to the connection strnig of the db you want to
use. Set the command's CommandText property to this query below. In your
code, open the connection by calling the Connection's Open method, the call
the ExecuteNonQuery on the command, then close the connection using the
connection's close method.

Does this make sense?
"Eashrak" <eashrak@gmail.com> wrote in message
news:%23QBr5jrPHHA.4372@TK2MSFTNGP04.phx.gbl...
> Hi
>
> I need to perform following querie in vb.net
>
> The queries are;
>
> NSERT INTO [destTbl] (field1, field2)
> SELECT srcTbl.field1, srcTbl.field2
> FROM srcTbl
> WHERE (((srcTbl.entry_id) Not In (SELECT srcTbl.entry_id FROM
> [destTbl])));
>
>
> In access I just run these query and job is done without any error in SQL
> View. What is the easiest way to execute this querie in
> ado.net/vb.net?
>
>
> Thanks
>
>
>



Re: Help with INSERT statement. by Eashrak

Eashrak
Thu Jan 25 06:15:09 CST 2007

thanks a lot
"W.G. Ryan [MVP]" <WilliamRyan@nospam.gmail.com> wrote in message
news:e8$U87yPHHA.1152@TK2MSFTNGP03.phx.gbl...
> Create a command and connection object. Set the connection's
> connectionString property to the connection strnig of the db you want to
> use. Set the command's CommandText property to this query below. In your
> code, open the connection by calling the Connection's Open method, the
> call the ExecuteNonQuery on the command, then close the connection using
> the connection's close method.
>
> Does this make sense?
> "Eashrak" <eashrak@gmail.com> wrote in message
> news:%23QBr5jrPHHA.4372@TK2MSFTNGP04.phx.gbl...
>> Hi
>>
>> I need to perform following querie in vb.net
>>
>> The queries are;
>>
>> NSERT INTO [destTbl] (field1, field2)
>> SELECT srcTbl.field1, srcTbl.field2
>> FROM srcTbl
>> WHERE (((srcTbl.entry_id) Not In (SELECT srcTbl.entry_id FROM
>> [destTbl])));
>>
>>
>> In access I just run these query and job is done without any error in SQL
>> View. What is the easiest way to execute this querie in
>> ado.net/vb.net?
>>
>>
>> Thanks
>>
>>
>>
>
>