vb.net - Return a single record from a SQL Server Stored Procedure, or use output parameters -


I am sending an order number, which is unique, from VB.NET to SQL Server through an archived methodology . Related records appear in the process table. I value the selected areas of that record in VB I want to return to the net. I can use it output parameters, which means that I have to define them in the process and then again in VB, or else I can return that single record and put it in a figure, then typing I can remove the values ​​to avoid Is there any reason that I should stay with the output parameter?

In your simplest scenario, I do not think the output parameter needs to be used. In addition, if your returns Value is just a single record that is the result of the final selection statement from your stored procedure, so you do not need the datatable (more than one record) infrastructure.

  dim cmd = New SqlCommand (procName, connection) cmd.CommandType = CommandType.StoredProcedure dim Reader = cmd.ExecuteReader () while Reader. Read () TextBox1.Text = reader (0) 'field from internal selection of already stored work .. ..' when other fields are finished    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -