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. General Programming
  3. C#
  4. Populating an XSD Dataset

Populating an XSD Dataset

Scheduled Pinned Locked Moved C#
helpdatabasetutorialquestion
3 Posts 3 Posters 0 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.
  • S Offline
    S Offline
    SignMan359
    wrote on last edited by
    #1

    I am trying to convert over a Crystal Reports report from using a database to using a dataset. That part seems to have gone along just fine. I followed the instruction Microsoft gives for doing that and also for creating an XSD dataset (which is how I was able to convert the report). I'm sure to most of you, the solution to my problem is simple. Here's my problem: I don't know how to get data into that dataset. I can't use the standard method of creating an OdbcDAtaAdapter and doing a Fill into the DataSet. I've tried, it doesn't work. I keep getting the following error if I try: Fill: SelectCommand.Connection property has not been initialized. Here's the command that generates the error: daDalyORHED.Fill(dsDalyData1, "orhed"); Here are the relevent parts of the code: daDalyORHED = new OdbcDataAdapter("SELECT * FROM PUB.orhed orhed WHERE OrdNum = '" + strOrdNum + "'", connDaly); connDaly = new OdbcConnection("DRIVER=MERANT 3.60 32-BIT Progress SQL92 v9.1D;UID=userid;HOST=siifpa001;PORT=apluslvsv;DB=apluslv;PWD=password"); dsDalyData dsDalyData1 = new dsDalyData(); Obviously, dsDalyData is the name of my XSD dataset. Can anybody please help me get my DataSet populated? It's kinda useless without that. :-D --In a world without fences, who needs Gates?

    L H 2 Replies Last reply
    0
    • S SignMan359

      I am trying to convert over a Crystal Reports report from using a database to using a dataset. That part seems to have gone along just fine. I followed the instruction Microsoft gives for doing that and also for creating an XSD dataset (which is how I was able to convert the report). I'm sure to most of you, the solution to my problem is simple. Here's my problem: I don't know how to get data into that dataset. I can't use the standard method of creating an OdbcDAtaAdapter and doing a Fill into the DataSet. I've tried, it doesn't work. I keep getting the following error if I try: Fill: SelectCommand.Connection property has not been initialized. Here's the command that generates the error: daDalyORHED.Fill(dsDalyData1, "orhed"); Here are the relevent parts of the code: daDalyORHED = new OdbcDataAdapter("SELECT * FROM PUB.orhed orhed WHERE OrdNum = '" + strOrdNum + "'", connDaly); connDaly = new OdbcConnection("DRIVER=MERANT 3.60 32-BIT Progress SQL92 v9.1D;UID=userid;HOST=siifpa001;PORT=apluslvsv;DB=apluslv;PWD=password"); dsDalyData dsDalyData1 = new dsDalyData(); Obviously, dsDalyData is the name of my XSD dataset. Can anybody please help me get my DataSet populated? It's kinda useless without that. :-D --In a world without fences, who needs Gates?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      It not the typed dataset's fault... something is wrong with your connection. Try to put connDaly = new... before the first line you posted (... new OdbcDataAdapter). It should work.

      1 Reply Last reply
      0
      • S SignMan359

        I am trying to convert over a Crystal Reports report from using a database to using a dataset. That part seems to have gone along just fine. I followed the instruction Microsoft gives for doing that and also for creating an XSD dataset (which is how I was able to convert the report). I'm sure to most of you, the solution to my problem is simple. Here's my problem: I don't know how to get data into that dataset. I can't use the standard method of creating an OdbcDAtaAdapter and doing a Fill into the DataSet. I've tried, it doesn't work. I keep getting the following error if I try: Fill: SelectCommand.Connection property has not been initialized. Here's the command that generates the error: daDalyORHED.Fill(dsDalyData1, "orhed"); Here are the relevent parts of the code: daDalyORHED = new OdbcDataAdapter("SELECT * FROM PUB.orhed orhed WHERE OrdNum = '" + strOrdNum + "'", connDaly); connDaly = new OdbcConnection("DRIVER=MERANT 3.60 32-BIT Progress SQL92 v9.1D;UID=userid;HOST=siifpa001;PORT=apluslvsv;DB=apluslv;PWD=password"); dsDalyData dsDalyData1 = new dsDalyData(); Obviously, dsDalyData is the name of my XSD dataset. Can anybody please help me get my DataSet populated? It's kinda useless without that. :-D --In a world without fences, who needs Gates?

        H Offline
        H Offline
        Hrashita Triapthi
        wrote on last edited by
        #3

        first drag n drop sqldataadpter component on ur form then one wizard will be shown click on the next option then it will ask for the server name give . for local host if u r using sql server authentication select that radio button else select windows authentication if u select sql server then give user name and password u acan leave password blank by checking allow blank password after that u give the database name u want to use and click on test connection if it give one message window with "TEST SUCCEED" then click ok and next there it will show u one query6 builder button click on it it will give u a list of ur tables in the database select tables from the list and add after rhat click next and then click on finish it will automatically create a sql connection for u then right click on sqldataadapter pasted on ur form one menu will be shown to u choose generate dataset use typed dataset and click ok after that drag n drop one datagrid on ur form write the following code in the page load event sqlDdataAadapter.Fill(dataset name); DataGrid1.Databind(); set properties OF DATA GRID DATASOURCE NAME DATATEXT FIELD TRY IT IT WILL SURELY WORK BEST OF LUCK TripathiH

        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