- 热门文章:
- · 实现一个客户端的DataSet-----ClientDataSet.htc
- · 安装framework以后出现不能显示aspx页面,提示用户名和密码不匹配问题的解决(chicken修改补充)
- · IIS5 HTTP500内部错误解决办法(转自eNet)------(一)
- · IIS5 HTTP500内部错误解决办法(转自eNet)------(二)
- · IIS5 HTTP500内部错误解决办法(转自eNet)-------(三)
- · page_Load和page_Init的区别
- · 关于如何添加一个自增的列【原创】
- · 获得存储过程返回值的方法(return的值)
- · 关于返回前面的页面。如何两者兼得,自问自答
- · 在ASP.NET中的变量数值管理------看了这个我基本上对原来的REQUEST.FORM的方法传递变量绝望了
- · XML技术上传文件-转贴
- · 在datagrid中的HyperLinkColumn上达到谈出一个窗口的效果
实现一个客户端的DataSet-----ClientDataSetDataProvider.asmx.cs(2)
// m_cmdAuthorsDelete
//
this.m_cmdAuthorsDelete.CommandText = @"DELETE FROM authors WHERE (au_id = @au_id) AND (address = @address OR @address1 IS NULL AND address IS NULL) AND (au_fname = @au_fname) AND (au_lname = @au_lname) AND (city = @city OR @city1 IS NULL AND city IS NULL) AND (contract = @contract) AND (phone = @phone) AND (state = @state OR @state1 IS NULL AND state IS NULL) AND (zip = @zip OR @zip1 IS NULL AND zip IS NULL)";
this.m_cmdAuthorsDelete.Connection = this.m_con;
this.m_cmdAuthorsDelete.Parameters.Add(new System.Data.SqlClient.SqlParameter("@au_id", System.Data.SqlDbType.Char, 11, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "au_id", System.Data.DataRowVersion.Original, null));
this.m_cmdAuthorsDelete.Parameters.Add(new System.Data.SqlClient.SqlParameter("@address", System.Data.SqlDbType.VarChar, 40, System.Data.ParameterDirection.Input, true, ((System.Byte)(0)), ((System.Byte)(0)), "address", System.Data.DataRowVersion.Original, null));
this.m_cmdAuthorsDelete.Parameters.Add(new System.Data.SqlClient.SqlParameter("@address1", System.Data.SqlDbType.VarChar, 40, System.Data.ParameterDirection.Input, true, ((System.Byte)(0)), ((System.Byte)(0)), "address", System.Data.DataRowVersion.Original, null));
this.m_cmdAuthorsDelete.Parameters.Add(new System.Data.SqlClient.SqlParameter("@au_fname", System.Data.SqlDbType.VarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "au_fname", System.Data.DataRowVersion.Original, null));
this.m_cmdAuthorsDelete.Parameters.Add(new System.Data.SqlClient.SqlParameter("@au_lname", System.Data.SqlDbType.VarChar, 40, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "au_lname", System.Data.DataRowVersion.Original, null));
this.m_cmdAuthorsDelete.Parameters.Add(new System.Data.SqlClient.SqlParameter("@city", System.Data.SqlDbType.VarChar, 20, System.Data.ParameterDirection.Input, true, ((System.Byte)(0)), ((System.Byte)(0)), "city", System.Data.DataRowVersion.Original, null));
this.m_cmdAuthorsDelete.Parameters.Add(new System.Data.SqlClient.SqlParameter("@city1", System.Data.SqlDbType.VarChar, 20, System.Data.ParameterDirection.Input, true, ((System.Byte)(0)), ((System.Byte)(0)), "city", System.Data.DataRowVersion.Original, null));
this.m_cmdAuthorsDelete.Parameters.Add(new System.Data.SqlClient.SqlParameter("@contract", System.Data.SqlDbType.Bit, 1, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "contract", System.Data.DataRowVersion.Original, null));
this.m_cmdAuthorsDelete.Parameters.Add(new System.Data.SqlClient.SqlParameter("@phone", System.Data.SqlDbType.Char, 12, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "phone", System.Data.DataRowVersion.Original, null));
this.m_cmdAuthorsDelete.Parameters.Add(new System.Data.SqlClient.SqlParameter("@state", System.Data.SqlDbType.Char, 2, System.Data.ParameterDirection.Input, true, ((System.Byte)(0)), ((System.Byte)(0)), "state", System.Data.DataRowVersion.Original, null));
this.m_cmdAuthorsDelete.Parameters.Add(new System.Data.SqlClient.SqlParameter("@state1", System.Data.SqlDbType.Char, 2, System.Data.ParameterDirection.Input, true, ((System.Byte)(0)), ((System.Byte)(0)), "state", System.Data.DataRowVersion.Original, null));
this.m_cmdAuthorsDelete.Parameters.Add(new System.Data.SqlClient.SqlParameter("@zip", System.Data.SqlDbType.Char, 5, System.Data.ParameterDirection.Input, true, ((System.Byte)(0)), ((System.Byte)(0)), "zip", System.Data.DataRowVersion.Original, null));
this.m_cmdAuthorsDelete.Parameters.Add(new System.Data.SqlClient.SqlParameter("@zip1", System.Data.SqlDbType.Char, 5, System.Data.ParameterDirection.Input, true, ((System.Byte)(0)), ((System.Byte)(0)), "zip", System.Data.DataRowVersion.Original, null));
//
// m_AuthorsAdapter
//
this.m_AuthorsAdapter.DeleteCommand = this.m_cmdAuthorsDelete;
this.m_AuthorsAdapter.InsertCommand = this.m_cmdAuthorsInsert;
this.m_AuthorsAdapter.SelectCommand = this.m_cmdAuthorsSelect;
this.m_AuthorsAdapter.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
new System.Data.Common.DataTableMapping("Table", "authors", new System.Data.Common.DataColumnMapping[] {
new System.Data.Common.DataColumnMapping("au_id", "au_id"),
new System.Data.Common.DataColumnMapping("au_lname", "au_lname"),
new System.Data.Common.DataColumnMapping("au_fname", "au_fname"),
new System.Data.Common.DataColumnMapping("phone", "phone"),
new System.Data.Common.DataColumnMapping("address", "address"),
new System.Data.Common.DataColumnMapping("city", "city"),
new System.Data.Common.DataColumnMapping("state", "state"),
new System.Data.Common.DataColumnMapping("zip", "zip"),
new System.Data.Common.DataColumnMapping("contract", "contract")})});
this.m_AuthorsAdapter.UpdateCommand = this.m_cmdAuthorsUpdate;
//
// m_PubsDataSet
//
this.m_PubsDataSet.DataSetName = "Pubs";
this.m_PubsDataSet.Locale = new System.Globalization.CultureInfo("en-US");
((System.ComponentModel.ISupportInitialize)(this.m_PubsDataSet)).EndInit();
}
#endregion
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
}
[
WebMethod
]
public DataSet GetPubs()
{
m_con.Open();
try
{
m_AuthorsAdapter.Fill(m_PubsDataSet);
}
finally
{
m_con.Close();
}
return m_PubsDataSet;
}
[
WebMethod
]
public void SaveChanges(DataSet dsPubs)
{
m_con.Open();
try
{
m_AuthorsAdapter.Update(dsPubs);
}
finally
{
m_con.Close();
}
}
}
}
相关文章:
- · 再datagrid中使用droplist。。。。重要的是其中的几个用法
- · 一个用C#做的HTTP SERVER(从WINFORM搬来的)
- · ViewState 到底是什么?
- · 允许用户一次上传多个文件
- · 用C# 实现Web文件的上传
- · ASP.NET Caching
- · ASP.NET Caching(2)
- · ASP.NET ViewState 初探 (3) 转自msdn
- · ASP.NET ViewState 初探 (2) 转自msdn
- · ASP.NET ViewState 初探 (1) 转自msdn
- · ASP.NET Framework深度历险(3)
- · ASP.NET下根据QueryString决定使用哪块javascript的两种方法 :)
- · ASP.NET Framework深度历险(2)
- · 图片上传的功能简介及web.config设置(自动生成所略图)
- · 图片上传的数据库部分(自动生成所略图)
- · 图片上传的WebForm(自动生成所略图)
- · 图片上传的Codebehind(自动生成所略图)
- · ASP.NET中的事务处理和异常处理
- · ASP.NET中异常处理使用(详细)
- · ASP.NET Framework深度历险(1)
- · 我写的上传(upload)文件的codebehind代码(1gdt)
- · 我写的上传(upload)文件的codebehind代码
- · 先装.net后装IIS的问题
- · Coalesys.WebMenu source code(partial)(5)
- · Coalesys.WebMenu source code(partial)(6)
- · Coalesys.WebMenu source code(partial)(7)
- · Coalesys.WebMenu source code(partial)(8)
- · Coalesys.WebMenu source code(partial)(9)
- · Coalesys.WebMenu source code(partial)(4)
- · Coalesys.WebMenu source code(partial)(10)
- · Coalesys.WebMenu source code(partial)(2)
- · Coalesys.WebMenu source code(partial)(1)
- · Coalesys.WebMenu source code(partial)(3)
- · .NET Framework環境下的ASP網頁製作(1) (王国荣)
- · .NET Framework環境下的ASP網頁製作(2)(王国荣)
- · 运行时修改Web.config中的元素值 zhenyu(原作)
- · 发送HTTP请求的两种方式
- · 关于上下文-2 (转自msdn)
