What now?...Dataset issue

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Phil Lamey

    #1

    What now?...Dataset issue

    I have the code below that I am using to load a dataset
    from and Oracle DB table called PARTNER (SNB).

    I then wish to load the information into a drop down but I
    am getting lost near the end of the code...I have it
    clearly marked below.

    Imports System.Data.Ole Db

    Public Class WebForm1
    Inherits System.Web.UI.P age
    Protected WithEvents drpPartners As
    System.Web.UI.W ebControls.Drop DownList

    Private Sub Page_Load(ByVal sender As System.Object,
    ByVal e As System.EventArg s) Handles MyBase.Load
    'Create the data connection.

    Dim oleDbConn As New OleDb.OleDbConn ection
    ("Provider=OraO LEDB.Oracle.1;P assword=xxxxxx; Persist
    Security Info=True;User ID=xxx;Data Source=xxxxx")
    Dim strSQL As String
    strSQL = "SELECT PARTNER.PARTNER _NAME_01,
    PARTNER.PARTNER _CD, PARTNER.PARTNER _TYPE_CD FROM
    SNB.PARTNER PARTNER WHERE PARTNER.PARTNER _TYPE_CD = '03'
    ORDER BY PARTNER.PARTNER _NAME_01"
    Dim dbAdapt As New OleDb.OleDbData Adapter(strSQL,
    oleDbConn)
    Dim dsPartners As New DataSet()
    dbAdapt.Fill(ds Partners, "Partner")
    'Display the table in a data grid using date binding

    ***Now here I am trying to follow an example I have
    seen.***
    'Dim rowNext As dsPartners.XXXX

    ****First: Intellisense does not seem to pick up and of
    the tables I put in for dsPartners and No matter what I
    put in for XXXX ...I get an error saying it is "undefined" .
    ********

    End Sub

    End Class

    **********I would greatly appreciate any help. I am
    obviously new at .NET (with experience in ASP). However.
    there must be something I am missing here.*****

    Thanks,

    Phil Lamey
  • Aaron

    #2
    What now?...Dataset issue

    If you want to bind the data in the data set to a
    datagrid try this :
    DataGrid1.DataS ource = dsPartners.Tabl es("Partner")

    if you're doing a asp page put
    datagrid1.datab ind
    after that statement


    Aaron[color=blue]
    >-----Original Message-----
    >I have the code below that I am using to load a dataset
    >from and Oracle DB table called PARTNER (SNB).
    >
    >I then wish to load the information into a drop down but[/color]
    I[color=blue]
    >am getting lost near the end of the code...I have it
    >clearly marked below.
    >
    >Imports System.Data.Ole Db
    >
    >Public Class WebForm1
    > Inherits System.Web.UI.P age
    > Protected WithEvents drpPartners As
    >System.Web.UI. WebControls.Dro pDownList
    >
    > Private Sub Page_Load(ByVal sender As System.Object,
    >ByVal e As System.EventArg s) Handles MyBase.Load
    > 'Create the data connection.
    >
    >Dim oleDbConn As New OleDb.OleDbConn ection
    >("Provider=Ora OLEDB.Oracle.1; Password=xxxxxx ;Persist
    >Security Info=True;User ID=xxx;Data Source=xxxxx")
    >Dim strSQL As String
    >strSQL = "SELECT PARTNER.PARTNER _NAME_01,
    >PARTNER.PARTNE R_CD, PARTNER.PARTNER _TYPE_CD FROM
    >SNB.PARTNER PARTNER WHERE PARTNER.PARTNER _TYPE_CD = '03'
    >ORDER BY PARTNER.PARTNER _NAME_01"
    >Dim dbAdapt As New OleDb.OleDbData Adapter(strSQL,
    >oleDbConn)
    >Dim dsPartners As New DataSet()
    >dbAdapt.Fill(d sPartners, "Partner")
    >'Display the table in a data grid using date binding
    >
    >***Now here I am trying to follow an example I have
    >seen.***
    >'Dim rowNext As dsPartners.XXXX
    >
    >****First: Intellisense does not seem to pick up and of
    >the tables I put in for dsPartners and No matter what I
    >put in for XXXX ...I get an error saying it[/color]
    is "undefined" .[color=blue]
    >********
    >
    > End Sub
    >
    >End Class
    >
    >**********I would greatly appreciate any help. I am
    >obviously new at .NET (with experience in ASP).[/color]
    However.[color=blue]
    >there must be something I am missing here.*****
    >
    >Thanks,
    >
    >Phil Lamey
    >.
    >[/color]

    Comment

    Working...