Re: ADO.Net 1.1 : SQL Insert ?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Sorry, but I gotta agree with Mark on this - we'd love to help, but not do
your job for you :-)

Anyway, Mark is right, you have to learn VB.NET and ADO.NET to convert this
code.

See you can't see heaven without dying yourself, so you've gotta learn .NET.

- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/


"Mark Rae" <mark@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:%23GvVjnbYFHA.3572@xxxxxxxxxxxxxxxxxxxxxxx
> "sam" <samuellai@xxxxxxxxxxxx> wrote in message
> news:e5pY1daYFHA.3864@xxxxxxxxxxxxxxxxxxxxxxx
>
>> How do I convert this ASP 3.0 to VB.Net coding?
>
> You're surely not expecting someone to write your code for you, are
> you...?
>
> 1) Create a stored procedure to fetch the records from F4111
>
> 2) Create a parameterised stored procedure to insert new records into
> F4111A
>
> 3) Fetch the records from F4111 into an SqlDataReader
>
> 4) Loop through the SqlDataReader and add the records to F4111A using the
> ExecuteNonQuery method calling the parameterised stored procedure.
>
> Alternatively, your code below appears to be copying the entire contents
> of F4111 into F4111A - why not just write a stored procedure to do the
> whole thing in one go?
>
>>
>>
>> ASP 3.0 Coding
>> -----------------
>> Set rs = Server.CreateObject("ADODB.Recordset")
>> rsstatm = "SELECT * FROM F4111"
>> rs.Open rsstatm, ConnSQL
>>
>> rs.movefirst
>>
>> do while not rs.eof
>>
>> rsAdd = "INSERT INTO F4111A (ILITM,ILLITM,ILAITM) VALUES"
>>
>> rsAdd = rsAdd & "( " & rs("ILITM")&","
>> rsAdd = rsAdd & "'" & rs("ILLITM") &"',"
>> rsAdd = rsAdd & "'" & rs("ILAITM") &"' )"
>>
>> ConnSQL.Execute(rsAdd)
>> Set rsAdd = Nothing
>>
>> rs.movenext
>> loop
>>
>> rs.close
>> Set rs = Nothing
>> Set rsstatm = Nothing
>>
>> Please help.
>>
>> Many thanks.
>>
>
>


.



Relevant Pages

  • Re: Selecting multiple checkboxes inside a GridView control
    ... Walk through all of the rows in the GridView and construct a comma-delimited string of the IDs of those which are checked. ... Create a stored procedure like below and pass the above string to it: ... Rem in the PRINT line and rem out the last two lines if you want to see what the dynamic SQL looks like first for testing purposes. ... Mark Rae ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: General architecture in BizTalk
    ... The SQL Adapter can only get data in two ways: ... read the next time the stored procedure gets fired. ... and either delete it or mark it read. ... Private blog: http://blog.eliasen.dk ...
    (microsoft.public.biztalk.general)
  • Re: JDBD: time format
    ... You just recompiled the stored procedure with time ... Mark wrote: ... Kent Milligan, DB2 & BI team ...
    (comp.sys.ibm.as400.misc)
  • Re: Dirk Kujit (Kuyt)
    ... Mark V. wrote: ... I've gotta say he's impressed me in the Liverpool matches I've seen ... Not to mention his boundless enthusiasm and extremely likable ...
    (rec.sport.soccer)
  • Re: SQL Enable FullText automaticly on reboot
    ... > have a much bigger problem than just how to mark it as a startup ... >> Create a stored procedure and mark it as a startup stored procedure ...
    (microsoft.public.sqlserver.programming)