I have the following code in my asp page:
Imports System.Data.SqlClient
Imports System.Data
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim dt As DataTable
Dim connectionString As String = "Initial Catalog=mdr;Data Source=xxxxx;uid=xxxxx;password=xxxxx"
Dim con As New SqlConnection(connectionString)
Dim cmd As New SqlCommand
cmd.Connection = con
con.Open()
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "getoncall"
cmd.Parameters.AddWithValue("@subschedule", TextBox1.Text)
cmd.ExecuteNonQuery()
Using da As New SqlDataAdapter(cmd)
dt = New DataTable
da.Fill(dt)
GridView1.DataSource = dt
GridView1.EmptyDataText = "No Records Found"
GridView1.DataBind()
con.Close()
con.Dispose()
End Using
End Sub
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
TextBox1.Text = ""
End Sub
End Class
and while the page doesn't throw me any errors, I'm also not seeing any data in my datatable. Can anyone maybe see why?
Thank you