1.建一个通用的处理数据的类
using System;
using System.Data;
using System.Data.SqlClient;
using System.Text;
namespace Document
{
    
/**//// <summary>
    
/// Summary description for DataHelper.
    
/// </summary>

    public class DataHelper
    
{
        
public DataHelper()
        
{
            
//
            
// TODO: Add constructor logic here
            
//
        }

        
public static string ConnectionString=System.Configuration.ConfigurationSettings.AppSettings["ConnectionString"];
    
        GetDataSet
GetDataSet

        ExecCommand
ExecCommand
        
        ExecuteScalar
ExecuteScalar

        ExecSPCommand
ExecSPCommand

        ExecSPDataSet
ExecSPDataSet

        DbType
DbType

        UpdateTable
UpdateTable

        InsertTable
InsertTable

        DeleteTable
DeleteTable

        updateRow
updateRow

        deleteRow
deleteRow

        midifyRow
midifyRow

        insertRow
insertRow
    }

}
2..调用范例
InsertInsert

        Update
Update

        Delete
Delete
posted on 2007-05-11 14:37  刺猬博客  阅读(491)  评论(0)    收藏  举报