VB.net and Stored Procedure 
Author Message
 VB.net and Stored Procedure

Hello,
    I am pulling some items from a list view and putting them into an array.
I want to save those items to my database is is possible to put all this
information into one transaction in the stored procedure?

Eric



Sat, 06 Aug 2005 03:18:28 GMT  
 VB.net and Stored Procedure
I've used a technique where I comma delimit the values in the array, then
pass to the stored proc in a "TEXT" datatype, then parse the comma delimited
table with this UDF in SQL*server, and then operate on the table.


= ',')

BEGIN






 -- For my loop to work I need an extra separator at the end.  I always look
to the
 -- left of the separator character for each array value



 BEGIN





  BEGIN


  END
  ELSE
  BEGIN


  END

  -- Loop through the string searching for separtor characters

  BEGIN
   -- patindex matches the a pattern against a string


   -- This is where you process the values passed.

   -- This replaces what we just processed with and empty string

  END
 END

 RETURN
END



Quote:
> Hello,
>     I am pulling some items from a list view and putting them into an
array.
> I want to save those items to my database is is possible to put all this
> information into one transaction in the stored procedure?

> Eric



Sat, 06 Aug 2005 04:02:07 GMT  
 VB.net and Stored Procedure
Hi  Eric

 you can use the ADO.NET Trasaction Option

http://msdn.microsoft.com/library/default.asp?
url=/library/en-
us/cpref/html/frlrfSystemDataSqlClientSqlConnectionClassBe
ginTransactionTopic1.asp

HTH
Raj [MVP]

Quote:
>-----Original Message-----
>Hello,
>    I am pulling some items from a list view and putting
them into an array.
>I want to save those items to my database is is possible
to put all this
>information into one transaction in the stored procedure?

>Eric

>.



Sat, 06 Aug 2005 04:10:18 GMT  
 VB.net and Stored Procedure
Is it possible to put stored procedure calls into thi Transaction Code
option instead of Insert statements? These are some pretty large
transactions so I am concerned with speed and reliablity. For example
instead of building the "insert into statement" into the BeginTransaction
and then doing an .ExecuteScaler. Can put the stored procedure there and
then ExecureScaler for each stored procedure. If there is an error can i
raise the error in the store procedure and roll back the transaction via the
vb code or do i roll back the transaction inside the stored procedure and
fail out of the vb code?

Eric


Quote:
> Hi  Eric

>  you can use the ADO.NET Trasaction Option

> http://msdn.microsoft.com/library/default.asp?
> url=/library/en-
> us/cpref/html/frlrfSystemDataSqlClientSqlConnectionClassBe
> ginTransactionTopic1.asp

> HTH
> Raj [MVP]

> >-----Original Message-----
> >Hello,
> >    I am pulling some items from a list view and putting
> them into an array.
> >I want to save those items to my database is is possible
> to put all this
> >information into one transaction in the stored procedure?

> >Eric

> >.



Sat, 06 Aug 2005 05:57:39 GMT  
 VB.net and Stored Procedure
Eric,

It's possible to use Transactions with stored procedures.  Depending on the
load (number of records), the other method I showed you is faster.

Look at SQLTransaction and SQLConnection object.  You open a SQLConnection,
build a Transaction on that connection, use the transaction (and connection)
on the SQLCommand.



Quote:
> Is it possible to put stored procedure calls into thi Transaction Code
> option instead of Insert statements? These are some pretty large
> transactions so I am concerned with speed and reliablity. For example
> instead of building the "insert into statement" into the BeginTransaction
> and then doing an .ExecuteScaler. Can put the stored procedure there and
> then ExecureScaler for each stored procedure. If there is an error can i
> raise the error in the store procedure and roll back the transaction via
the
> vb code or do i roll back the transaction inside the stored procedure and
> fail out of the vb code?

> Eric



> > Hi  Eric

> >  you can use the ADO.NET Trasaction Option

> > http://msdn.microsoft.com/library/default.asp?
> > url=/library/en-
> > us/cpref/html/frlrfSystemDataSqlClientSqlConnectionClassBe
> > ginTransactionTopic1.asp

> > HTH
> > Raj [MVP]

> > >-----Original Message-----
> > >Hello,
> > >    I am pulling some items from a list view and putting
> > them into an array.
> > >I want to save those items to my database is is possible
> > to put all this
> > >information into one transaction in the stored procedure?

> > >Eric

> > >.



Sat, 06 Aug 2005 09:50:06 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. ASP.net VB.Net Stored Procedures in SQL Server

2. VB.Net => Ado.Net = Stored Procedure

3. Create Stored Procedures in VB.NET

4. Getting Stored Procedure text with vb.net

5. VB.NET,SQL SERVER 2000 STORED PROCEDURE PARAMETERS, CRYSTAL REPORTS

6. VB.Net Stored Procedure Generation

7. Parameter to Stored Procedure CR 8.5 VB.Net Specified Cast Not Valid

8. Passing Parameters to a Stored Procedure from VB.NET

9. To Stored Procedure or not to stored procedure

10. To stored procedure or not to stored procedure

11. sub report changes its source stored procedure to main report's stored procedure

12. To stored procedure or not to stored procedure

 

 
Powered by phpBB® Forum Software