Populating an XSD Dataset
-
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?
-
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?
-
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?
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