EDN Admin
Well-known member
Hello,
I am using the following code to fill a gridview
Try<br/>
Dim MySQL As String = "Select id,comp_name,int_grnt_end_date,first_extend_date,second_extend_date,third_extend_date," _<br/>
& "final_extend_date,notes from reg_comp_tbl " _<br/>
& "where cont_id=" & file_no_txt.Text & " and cont_type=" & Cont_type_txt.Text & ""
<br/>
Dim strConn As String = "server=appserver2008;database=following_pro;UID=Bodour2;PASSWORD=1111"<br/>
Dim MyConn As New SqlConnection(strConn)
Dim ds As DataSet = New DataSet<br/>
Dim dr As SqlDataAdapter = New SqlDataAdapter(MySQL, MyConn)
dr.Fill(ds, "reg_comp_tbl")<br/>
GridView1.DataSource = ds.Tables("reg_comp_tbl").DefaultView<br/>
GridView1.DataBind()<br/>
----------------
Catch ex As Exception<br/>
Response.Write(ex.Message)<br/>
End Try
but I have the following run time error
Specified argument was out of the range of valid values. Parameter name: index
View the full article
I am using the following code to fill a gridview
Try<br/>
Dim MySQL As String = "Select id,comp_name,int_grnt_end_date,first_extend_date,second_extend_date,third_extend_date," _<br/>
& "final_extend_date,notes from reg_comp_tbl " _<br/>
& "where cont_id=" & file_no_txt.Text & " and cont_type=" & Cont_type_txt.Text & ""
<br/>
Dim strConn As String = "server=appserver2008;database=following_pro;UID=Bodour2;PASSWORD=1111"<br/>
Dim MyConn As New SqlConnection(strConn)
Dim ds As DataSet = New DataSet<br/>
Dim dr As SqlDataAdapter = New SqlDataAdapter(MySQL, MyConn)
dr.Fill(ds, "reg_comp_tbl")<br/>
GridView1.DataSource = ds.Tables("reg_comp_tbl").DefaultView<br/>
GridView1.DataBind()<br/>
----------------
Catch ex As Exception<br/>
Response.Write(ex.Message)<br/>
End Try
but I have the following run time error
Specified argument was out of the range of valid values. Parameter name: index
View the full article