tags:

views:

78

answers:

4

I want to create a dataset.xsd in vs2005, and I am using access database, so I cant know where my client save the application. Hence I used application.startuppath() to get the application folder and appended "Data\db.msd" to the application.startuppath() so i got the target location for the access databse in client machine. Now to create crystal reports I need the dataset.xsd but while creating a new dataset.xsd it was asking the path for the access database, how to programmatically specify the connection string in dataset.xsd so that i can create a connection string. and use that dataset for creating crystal reports.

Thanks in advance

A: 

Is it possible that the connection is only used to get the schema of the dataset.

Will you be filling the dataset using a DataReader?

If so i dont think the connection to the dataset is important, it is only to get the schema. You can create the dataset amnually, if it not to mutch effort, and populate it using the appropriate data reader.

astander
A: 

You can use AppSettings to store the connection string and retrieve it at runtime. You can then store the connection string information under configuration -> connectionStrings and retrieve it from the application. You could then modify the connection string without having to modify the code.

Your app.settings would look like this (simplified) and replace the ** with your own connection string:

<configuration> <connectionStrings> <add connectionString ="******" name="AccessConnectionString"/> </connectionStrings> <appSettings> </appSettings> </configuration>

Dim AccessConnectionString As String = System.Configuration.ConfigurationManager.ConnectionStrings.Item("AccessConnectionString").ConnectionString theConnectionObject.ConnectionString = AccessConnectionString theDataAdapter.Fill(theDataSet)

calico-cat
A: 

Thank you so much

But in the dataset can you tell me how to create table adapter programatically, My actual problem is to create crystal reports, but I dont know the path where My client stores the application, when i am creating the data source I dont know the actual path of the application foler as I have to specify the database there.

ashok
A: 

Thank you so much

But in the dataset can you tell me how to create table adapter programatically, My actual problem is to create crystal reports, but I dont know the path where My client stores the application, when i am creating the data source I dont know the actual path of the application foler as I have to specify the database there.

ASHOK