SolidSnake@GTI
New Member
I have the following code... <BR><BR>You will notice that it has the sorting of column enabled. However, my problem is when I click the sorting column the data set does not load because it is looking for the mytext.value. My question is how can I make it so it doesn't check for mytext.value once the ds has been filled? <BR><BR>Thanks much<BR><BR><script language="VB" runat="server"><BR>Sub GetInvoices_Click(Sender As Object, E As EventArgs) <BR> Dim DS As DataSet<BR> Dim MyConnection As SqlConnection<BR> Dim MyCommand As SqlDataAdapter<BR><BR> Dim SelectCommand As String = "my SQL.."<BR><BR> MyConnection = New SqlConnection("my connection")<BR> MyCommand = New SqlDataAdapter(SelectCommand, MyConnection)<BR><BR> MyCommand.SelectCommand.Parameters.Add(New SqlParameter("@Password", SqlDbType.NVarChar, 10))<BR> MyCommand.SelectCommand.Parameters("@Password").Value = http://aspmessageboard.com/archive/index.php/MyText.Value<BR><BR> DS = new DataSet()<BR> MyCommand.Fill(DS, "Invoices")<BR><BR> MyDataGrid.DataSource=DS.Tables("Invoices").DefaultView<BR> If ds.tables("Invoices").rows.count <> 0<BR> 'Password was matched with one of the records...<BR> lblOutput.text = "Password Excepted.."<BR> Response.Write ("<BR><BR>")<BR> MyDataGrid.DataBind()<BR> Else<BR> lblOutput.text = "Invalid password please try again!"<BR> <BR> End if<BR> <BR> End Sub<BR> <BR> <BR> Sub dispDetails(sender as Object, e As DataGridCommandEventArgs)<BR> lblOutput2.Text = "You clicked one of the details buttons!"<BR> End Sub<BR></script><BR>try this<BR>if isnothing(DS) = True then<BR>...Hello thanks for you help...but it is not working still...here is my modified script...<BR><BR><script language="VB" runat="server"><BR>Sub GetInvoices_Click(Sender As Object, E As EventArgs) <BR> Dim DS As DataSet<BR> Dim MyConnection As SqlConnection<BR> Dim MyCommand As SqlDataAdapter<BR><BR> Dim SelectCommand As String = "my SQL"<BR><BR> MyConnection = New SqlConnection("My Connection")<BR><BR> MyCommand.SelectCommand.Parameters.Add(New SqlParameter("@Password", SqlDbType.NVarChar, 10))<BR> MyCommand.SelectCommand.Parameters("@Password").Value = MyText.Value<BR><BR> If isnothing(DS) = True then<BR> DS = new DataSet()<BR> MyCommand.Fill(DS, "Invoices")<BR><BR> MyDataGrid.DataSource=DS.Tables("Invoices").DefaultView<BR> If ds.tables("Invoices").rows.count <> 0<BR> 'Password was matched with one of the records...<BR> lblOutput.text = "Password Excepted.."<BR> Response.Write ("<BR><BR>")<BR> MyDataGrid.DataBind()<BR> Else<BR> lblOutput.text = "Invalid password please try again!"<BR> <BR> End if<BR> End if<BR> <BR> End Sub<BR> <BR> <BR> Sub dispDetails(sender as Object, e As DataGridCommandEventArgs)<BR> lblOutput2.Text = "You clicked one of the details buttons!"<BR> End Sub<BR></script>you probably only need to bind your data on the first page load..<BR>try something like this<BR><BR>sub Page_Load(sender as Object, e as EventArgs)<BR> If Not Page.IsPostBack then<BR> 'bind your dataset<BR> End If<BR>end subHi this won't work because I am getting value from a text box and the sub is fired upon on click event. I am so lost with ASP.net it is not even funny 
