Penggunaan Stored Procedure dan Sql Data Adapter pada vb.net

Posted On // Leave a Comment
Dim conn As New SqlConnection(strConn)
Dim cmd As New SqlCommand("MyStoredProcedure", conn)
With cmd
    .CommandType = CommandType.StoredProcedure
    .Parameters.Add("@pdata", SqlDbType.VarChar, 100)
    .Parameters("@pdata").Value = "Whatever"
End With
Dim da As New SqlDataAdapter(cmd)
Dim ds As New DataSet
da.Fill(ds)

0 komentar: