将多个值发送到登录页面 [英] Send Multiple Values to login page

查看:88
本文介绍了将多个值发送到登录页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我点击注册数据库表中保存的所有详细信息时,我有一个注册页面,

i在该一个uploadfile控件中创建另一个页面并创建用户按钮

in csv文件包含我想用逗号分隔的所有细节

iam仅在我上传文件时上传csv文件,当我点击创建用户时我想在数据库中注册所有

i have one register page when i click register all details saved in the database table,
i have another page in that one uploadfile control and create users button
in that csv file contains all details what i want seperated by comma
iam upload csv files only if i upload file and when i click create users i want register all in database

推荐答案

Follow these steps to achieve the same

1. On click of upload file read the .csv file and store the data into DataTable. for example 200 columns with 100 Rows
2. On click of button "Create user" Send this datatable to the form which will display all the users list which needs to be added.
3. Insert the data into database by either normal looping on the datatable or by Bulk insert into database.


有很多方法可以插入文件数据库中的记录

1.用逗号或管道分隔创建文件csv或文本文件,无论你想要什么

2.通过编码读取该文件并读取行n列明智记录

3.使用列创建数据表并在dataTable中添加文件记录值

4.数据集设置为数据集如



ds.add.table(datatable)




sql server 2008中的




1.创建一个没有列的文件类型的表格



2.创建一个结构类型参数的过程,只读



然后在程序中编写代码以从该参数读取记录,例如



create proc user_Reister(



@userlist结构只读





as

...

select * from @userlist





来自vb.net或c#.net



5.将数据集设置为这样的参数值



cmd.parameter(@ userlist)。value = ds.Table(0)







然后你可以阅读程序中的所有记录



i希望它能帮助你批量插入



注意使用sql server 2008及以上DB
there is many ways to insert file records in database
1. create file csv or text file with comma or pipe separated ,whatever you want
2.read that file by coding and read row n column wise record
3. create Datatable with column and add the file recorded value in dataTable
4. Datatable set to Dataset like

ds.add.table(datatable)


in sql server 2008

1. create one table type with no of column which u have in file

2. create one procedure with structure type parameter with read only

then write code in procedure for read record from that parameter like

create proc user_Reister(

@userlist structure readonly

)
as
...
select * from @userlist


from vb.net or c#.net

5. set Dataset to parameter value like this

cmd.parameter("@userlist ").value = ds.Table(0)



then you can read all record in procedure

i hope it will help u for bulk insert

Note use sql server 2008 and above DB


这篇关于将多个值发送到登录页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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