Type Dataset with database

D

David Lei

You can create a Typed DataSet from Add New Item...from VS
From there, you can either use server explorer to pull a table from a sql
server
or define your own XML schema for the dataset.

david
 
M

Mark Lyday

I am trying to use Crystal reports to create a report for a dotnet app I am
writing. Crystal reports only works with type dataset, which is where I
have my problem.

I know how to create the typed dataset if my data is comming from a database
table.

My situation is a little different. The report I am creating pulls data
from many different spots and create a dataset on the fly by adding a
datatable to the dataset then doing an new datacolumn for each column.

The column will always stay the same do I dont have a problem creating the
type dataset beforhand, but I cant find anything telling me how to do it
with pulling the column from a data base table.

Any help would be appreciated.

Mark
 
W

W.G. Ryan eMVP

You can use TableMappings and ColumnMappings to specify what data should
come from where. As long as the schema of the dataset stays constant, you
can build your report based on it. Remember that you don't have to use a
Database at all to use datasets, so if you have the data, you can add rows
locally to the dataset/datatable that have wahtever data you want. For
instance, say I have a dataset with one table (Table1) and two columns
(Column1, Column2).

So lets say that I just filled the dataset with a database query. Now I
want to add two rows of my own.

I can do DataRow dro = MydataSet.Table1.NewRow();
dro["Column1"] = "Whatever";
dro["Column2"] = "Whateverelse";
MydataSet.Table1.Rows.Add(dro); //Using typed datasets you can reference the
columns directly of course instance of ["Column1"] . So now I have data
mixed from two sources. You can build your dataset like this and then just
call the report.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top