Hello everyone, I have here a code but my problem is that how can i add the value of the result in my gridview. Actually when I put msgbox to the "myString" it result 3 by 3 and that's what i want but the problem is that how can i call all of those strings to display on one column of gridview and each value from my database is beside them? Could anyone help me this? This is my code:
Thanks in advance.Code:Dim CSCode As String = = "123456789" Dim myString As String For z As Integer = 0 To CSCode.Length - 1 Step 3 myString = CSCode.Substring(z, 3) Dim objConn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("database\myData.mdb") & ";") Dim strSQL As String strSQL = "SELECT Classification FROM Classification WHERE ClassCode LIKE '" & myString & "'" Dim objCmd As New OleDbCommand(strSQL, objConn) Dim objDA As New OleDbDataAdapter() objDA.SelectCommand = objCmd objConn.Open() Dim objDS As DataSet = New DataSet() objDA.Fill(objDS, "Classification") ClassGrid.DataSource = objDS ClassGrid.DataBind() objConn.Close() Next![]()




Reply With Quote