Re: ADO.Net 1.1 : SQL Insert ?
- From: "Sahil Malik [MVP]" <contactmethrumyblog@xxxxxxxxxx>
- Date: Thu, 26 May 2005 04:47:11 -0400
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.
>>
>
>
.
- References:
- ADO.Net 1.1 : SQL Insert ?
- From: sam
- Re: ADO.Net 1.1 : SQL Insert ?
- From: Mark Rae
- ADO.Net 1.1 : SQL Insert ?
- Prev by Date: Re: Dataview filtering problem
- Next by Date: Re: Merging XML Documents (with ADO.NET?)
- Previous by thread: Re: ADO.Net 1.1 : SQL Insert ?
- Next by thread: Re: ADO.Net 1.1 : SQL Insert ?
- Index(es):
Relevant Pages
|