Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. datagrid will not populate

datagrid will not populate

Scheduled Pinned Locked Moved ASP.NET
databasequestion
3 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    cavall
    wrote on last edited by
    #1

    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

    M 1 Reply Last reply
    0
    • C cavall

      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

      M Offline
      M Offline
      Marcie Jones
      wrote on last edited by
      #2

      Can you elaborate on "kaput"? :) Marcie CP Blog[^]

      C 1 Reply Last reply
      0
      • M Marcie Jones

        Can you elaborate on "kaput"? :) Marcie CP Blog[^]

        C Offline
        C Offline
        cavall
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups