使用Webform作为数据源的数据集创建 [英] dataset creation which uses webform as its datasource

查看:55
本文介绍了使用Webform作为数据源的数据集创建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个数据集,该数据集从Web表单字段获取其数据输入(该数据集与数据库或服务器都没有连接).然后从数据集中生成报告.

非常感谢

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

推荐答案

数据集可以在没有数据库连接的情况下创建.创建一个数据集,然后在其中创建一个数据表,其中的列与您的Webform字段匹配.在提交网络表单时,您可以填充此数据集.

或者,本文可帮助您绑定到对象而不是数据集

将Web表单数据绑定到对象而不是数据集 [
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[^]



只需执行以下操作:(无数据库)

Hi,
Just do the following: (without Database)

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();



谢谢,
Imdadhusen



Thanks,
Imdadhusen


希望 [
Hope this[^] may help you.


这篇关于使用Webform作为数据源的数据集创建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆