B
Backwards
Hi all,
Take this to be a very simple question. I have done a little dotnet
forms programing and now trying to create a custom internal website to
dispaly ever changing data but i seem to be having a problem adding a
gridview on.
here is the code i have but the gridview doesnt even show on the page
at all let alone the data.
Protected Sub Btn_details_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Btn_details.Click
Me.Image1.Visible = True
Me.Label1.Visible = True
Dim sqlhost As New
SqlClient.SqlConnection("Server=es70001;Database=host;trusted_connection=yes;")
sqlhost.Open()
Dim cmdhost As New SqlClient.SqlCommand
cmdhost.CommandText = "Select S2KStoreNbr, ServerName,
HostServerName, SQLVersion, SMS_IP, StoreLine_IP from
tbProdDelActStore where servername = '" + Me.DropDownList1.Text + "'"
cmdhost.CommandType = CommandType.Text
cmdhost.Connection = sqlhost
cmdhost.ExecuteNonQuery()
Dim ds As New DataSet
Dim da As New SqlDataAdapter(cmdhost)
da.Fill(ds, "Output")
GridView1.DataSource = ds
GridView1.DataMember = "Output"
GridView1.Visible = True
sqlhost.Close()
Me.Image1.Visible = False
Me.Label1.Visible = False
End Sub
Take this to be a very simple question. I have done a little dotnet
forms programing and now trying to create a custom internal website to
dispaly ever changing data but i seem to be having a problem adding a
gridview on.
here is the code i have but the gridview doesnt even show on the page
at all let alone the data.
Protected Sub Btn_details_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Btn_details.Click
Me.Image1.Visible = True
Me.Label1.Visible = True
Dim sqlhost As New
SqlClient.SqlConnection("Server=es70001;Database=host;trusted_connection=yes;")
sqlhost.Open()
Dim cmdhost As New SqlClient.SqlCommand
cmdhost.CommandText = "Select S2KStoreNbr, ServerName,
HostServerName, SQLVersion, SMS_IP, StoreLine_IP from
tbProdDelActStore where servername = '" + Me.DropDownList1.Text + "'"
cmdhost.CommandType = CommandType.Text
cmdhost.Connection = sqlhost
cmdhost.ExecuteNonQuery()
Dim ds As New DataSet
Dim da As New SqlDataAdapter(cmdhost)
da.Fill(ds, "Output")
GridView1.DataSource = ds
GridView1.DataMember = "Output"
GridView1.Visible = True
sqlhost.Close()
Me.Image1.Visible = False
Me.Label1.Visible = False
End Sub