Click here to Skip to main content
16,007,885 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to create a dataset which gets its data input from a web form fields(the dataset has no connection to a database nor a server). And then generate a report from the dataset.

thanks a lot
Posted

Hi Dataset can be created without a database connection. Create a dataset and then create a datatable in with columns matching to your webform fields. On submit the webform you may populate this dataset.

Alternatively this article helps you to bind to an object instead of dataset

Databinding Web Forms to Objects as opposed to Datasets[^]
 
Share this answer
 
v2
Hi,
Just do the following: (without Database)

C#
DataTable dtUser = new DataTable();
dtUniq.Columns.Add(new DataColumn("Name", typeof(string)));
dtUniq.Columns.Add(new DataColumn("City", typeof(string)));
dtUniq.Columns.Add(new DataColumn("State", typeof(string)));
dtUniq.Columns.Add(new DataColumn("Email", typeof(string)));
dtUniq.Columns.Add(new DataColumn("Mobile", typeof(string)));

DataRow drUser = dtUser.NewRow();
drUser["Name"] = "Imdadhusen";
drUser["City"] = "Ahmedabad";
drUser["State"] = "Gujarat";
drUser["Email"] = "i_sunasara@yahoo.com";
drUser["Mobile"] = "9909544184";
dtUser.Rows.Add(drUser);

//Bind Report with dtUser
CrystalReportViewer1.ReportSource = dtUser;
CrystalReportViewer1.DataBind();


Thanks,
Imdadhusen
 
Share this answer
 
Comments
[no name] 11-Feb-11 3:57am    
Dont display the correct mailid, mobile no.
Hope this[^] may help you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900