数据交换学习二:asp.net C# 对 sqlserver表的操作
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient;
//显示数据示例
public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//创建表及插入数据
//use jwcrm
//create table userinfo(username char(10),userpwd char(10))
//insert into userInfo values('潘万飞','123456')
//insert into userInfo values('李世明','678910')
//select * from userinfo
//连接SQL
SqlConnection thisConnection = new SqlConnection("Server=127.0.0.1;uid=sa;pwd=123;database=jwcrm");
//创建数据库适配器
SqlDataAdapter thisAdapter = new SqlDataAdapter("select * from userinfo", thisConnection);
SqlCommandBuilder thisBuilder = new SqlCommandBuilder(thisAdapter);
DataSet thisDataSet = new DataSet();
thisAdapter.Fill(thisDataSet, "userinfo");
int i = 0;
foreach(DataRow rowData in thisDataSet.Tables[0].Rows)
{
i++;
&n
相关文档:
在ASP中,将文件上传到服务器是一件非常麻烦的事情,通常需要第三方组件的支持。
在ASP.NET 1.x 中,要支持文件上传,只须使用HTML的Input(File)控件。把它作为服务器控件运行(手动设置runat="server") ,要直接操作 HttpPostedFile。
在ASP.NET 2.0中,新增了FileUpLoad服务器控件,使得上传更加简单。
包& ......
//TransmitFile实现下载
protected void Button1_Click1(object sender, EventArgs e)
{
/*
&n ......
ASP.NET Excel导入到SQL Server数据库
提供把Excel里的数据导入到SQL Server 数据库,前提是Excel里的字段在Sql Server表里都有,不然会出现错误。注释很详细哦!要引用的命名空间是:
using System.Data.OleDb;
using System.Data.SqlClient;
//操作类
public class ExcelToSQL
{
& ......
概述:
配置 Web 同步
url: http://technet.microsoft.com/zh-cn/library/ms151810(SQL.90).aspx
若要对复制使用 Web 同步,请执行下列步骤:
配置发布,以允许使用 Web 同步。
配置运行 Microsoft Internet 信息服务 (IIS) 的计算机以同步订阅。支持 IIS 5.0 和 6.0 版。
配置一个或多个订阅以使用 Web 同步。
......
今天在VS2005调试一个C# C/S程序,当通过RFC与SAP连接时间过长时,出现此错误,在网上找到解决办法。
VS2008上的一个程序,通过Oracle.DataAccess.dll执行drop user
cascade操作,我在sqlplus执行此操作大约需要一分钟左右时间,当我在VS2008中debug启动此程序时,一直接收到
“ContextSwitchDeadlock is detected& ......