Community discussion forum

How to get the value from SQL string??

  • 1 year ago

    Hi,

    I want to get the value from SQl string .Please let me know

     

    Public
    Shared Sub SQLExecute(ByVal strSQL As String)

    Dim Conn As New SqlConnection(getConnectionString)

    Dim cmd As New SqlCommand(strSQL, Conn)With cmd

    .Connection.Open()

    .ExecuteNonQuery()

    .Connection.Close()

    .Dispose()

    End With

    End Sub

  • 1 year ago

     

    Hello,

    You can try using the concept of the DataReader. This allows you to loop through the rows and retrieve a value

    for the individual columns. You can try visit the given web link. This wiill give you a fair idea on the implementation

    of DataReader.

    http://www.startvbdotnet.com/ado/sqlserver.aspx

    I hope this will assist you.

    Regards,

    Allen Smith

    ComponentOne LLC

    www.componentone.com

Post a reply

Enter your message below

Sign in or Join us (it's free).

Want to stay in touch with what's going on? Follow us on twitter!