将空白表导入asp.net webforms [英] import blank table to the asp.net webforms

查看:45
本文介绍了将空白表导入asp.net webforms的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨我想创建一个备用数据库应用程序,所以在创建数据库后,有必要导航到表页面的创建,所以我想知道如何实现这个表我是初学者asp.net所以立即想要这个答案所以请帮助我....

提前感谢....

hi i want to create a alternate database applications so after creating database it is necessary to navigate to the creation of table page so i want to know the how can
i achieve this table i am beginner to asp.net so want this answer immediately so please help me....
thanks in advance....

推荐答案

使用InMemory数据表像这样:

Use InMemory data Table Like this:
DataTable table = new DataTable("Table");
            DataColumn[] keys = new DataColumn[1];
            DataColumn column;
            column = new DataColumn();
            column.ColumnName = "Item_Id";
            column.DataType = Type.GetType("System.Int32");
            table.Columns.Add(column);
            keys[0] = column;
            table.PrimaryKey = keys;
            table.Columns.Add("InvoiceDetailId", Type.GetType("System.Int32"));
            table.Columns.Add("item_name", Type.GetType("System.String"));
            table.Columns.Add("invoice_date", Type.GetType("System.DateTime"));
            table.Columns.Add("customer_id", Type.GetType("System.Int32"));
            table.Columns.Add("currency", Type.GetType("System.String"));
            table.Columns.Add("invoice_no", Type.GetType("System.Int32"));
            table.Columns.Add("type", Type.GetType("System.Char"));
            table.Columns.Add("Quantity", Type.GetType("System.Int32"));
            table.Columns.Add("Price", Type.GetType("System.Decimal"));
            table.Columns.Add("Discount_Per", Type.GetType("System.Decimal"));
            table.Columns.Add("Tax_Per", Type.GetType("System.Decimal"));
            table.Columns.Add("Amount", Type.GetType("System.Decimal"));
            table.Columns.Add("Discount_Amount", Type.GetType("System.Decimal"));
            table.Columns.Add("Tax_Amount", Type.GetType("System.Decimal"));
            table.Columns.Add("Net_Total", Type.GetType("System.Decimal"));
            Session["invoice"] = table;


使用Datatable然后将数据表内容插入数据库。



参考这些链接

http://www.dotnetfunda.com/articles/article131.aspx [ ^ ]



http:// asp-net- example.blogspot.in/2011/04/datatable-how-to-create-datatable.html [ ^ ]
Use Datatable then insert datatable content to database.

Refer these Link
http://www.dotnetfunda.com/articles/article131.aspx[^]

http://asp-net-example.blogspot.in/2011/04/datatable-how-to-create-datatable.html[^]


这篇关于将空白表导入asp.net webforms的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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