datagrid will not populate
-
Can someone please check this out and see what I could possibly be doing in my sql wrong? (code follows) If I put a simple ("SELECT * FROM VENDORGROUP", strConn) in there it populates and displays, but when I put this code in... kaput... Thanks Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here Dim OpCode As String Dim Vendor As String Dim StartDate As String Dim EndDate As String If Not Page.IsPostBack Then If Request.QueryString("oc") <> "" And Request.QueryString("vnd") <> "" And Request.QueryString("sdate") <> "" And Request.QueryString("edate") <> "" Then txtOtherOpCode.Text() = Request.QueryString("oc") OpCode = txtOtherOpCode.Text() txtOtherVendor.Text = Request.QueryString("vnd") Vendor = txtOtherVendor.Text lblOtherStartDate().Text = Request.QueryString("sdate") StartDate = lblOtherStartDate().Text lblOtherEndDate().Text = Request.QueryString("edate") EndDate = lblOtherEndDate().Text End If End If Dim strConn As New OleDbConnection("Provider=""MSDAORA.1"";User ID=catvqm;Data Source=VQM;Password=catvqm") strConn.Open() Dim da As New OleDbDataAdapter("SELECT VENDORGROUP.VG_DESC, VENDORGROUP.GROUP_NUM, VENDORGROUPDTL.VENDOR_NUM, VENDORGROUP.GRP_UDEF_A FROM VENDORGROUP, VENDORGROUPDTL WHERE VENDORGROUP.GROUP_NUM = VENDORGROUPDTL.GROUP_NUM AND VENDORGROUP.GROUP_NUM = '" & OpCode & "'", strConn) Dim ds As New DataSet da.Fill(ds, "VENDDESCRIPTION") strConn.Close() dg.DataSource = ds dg.DataBind() End Sub "Nothing is at last sacred, but the integrity of your own mind." "What lies behind us and what lies before us are nothing compared to what lies within us." - Ralph Waldo Emerson
-
Can someone please check this out and see what I could possibly be doing in my sql wrong? (code follows) If I put a simple ("SELECT * FROM VENDORGROUP", strConn) in there it populates and displays, but when I put this code in... kaput... Thanks Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here Dim OpCode As String Dim Vendor As String Dim StartDate As String Dim EndDate As String If Not Page.IsPostBack Then If Request.QueryString("oc") <> "" And Request.QueryString("vnd") <> "" And Request.QueryString("sdate") <> "" And Request.QueryString("edate") <> "" Then txtOtherOpCode.Text() = Request.QueryString("oc") OpCode = txtOtherOpCode.Text() txtOtherVendor.Text = Request.QueryString("vnd") Vendor = txtOtherVendor.Text lblOtherStartDate().Text = Request.QueryString("sdate") StartDate = lblOtherStartDate().Text lblOtherEndDate().Text = Request.QueryString("edate") EndDate = lblOtherEndDate().Text End If End If Dim strConn As New OleDbConnection("Provider=""MSDAORA.1"";User ID=catvqm;Data Source=VQM;Password=catvqm") strConn.Open() Dim da As New OleDbDataAdapter("SELECT VENDORGROUP.VG_DESC, VENDORGROUP.GROUP_NUM, VENDORGROUPDTL.VENDOR_NUM, VENDORGROUP.GRP_UDEF_A FROM VENDORGROUP, VENDORGROUPDTL WHERE VENDORGROUP.GROUP_NUM = VENDORGROUPDTL.GROUP_NUM AND VENDORGROUP.GROUP_NUM = '" & OpCode & "'", strConn) Dim ds As New DataSet da.Fill(ds, "VENDDESCRIPTION") strConn.Close() dg.DataSource = ds dg.DataBind() End Sub "Nothing is at last sacred, but the integrity of your own mind." "What lies behind us and what lies before us are nothing compared to what lies within us." - Ralph Waldo Emerson
-
i think I figured out what that problem was... wrong fieldname... oops! ;-) Thanks for replying! "Nothing is at last sacred, but the integrity of your own mind." "What lies behind us and what lies before us are nothing compared to what lies within us." - Ralph Waldo Emerson