• λ我爱Aspx >> C#.Net >> 三层架构之数据库访问层完全篇(C#)
  • 三层架构之数据库访问层完全篇(C#)

  • :aspxer  Դ:internet  :2007-5-20 15:28:48  ؼ:c#,数据库,数据,三层
  • else

    {

    return (int)r;

    }

    }

    catch(System.Data.SqlClient.SqlException e)

    {

    throw new Exception(e.Message);

    }

    finally

    {

    myCmd.Dispose();

    myCn.Close();

    }

    }

    /// <summary>

    /// get object

    /// </summary>

    /// <param name="strSQL">(string)</param>

    /// <returns>(object)</returns>

    protected static object ExecuteSql4ValueEx(string strSQL)

    {

    SqlConnection myCn = new SqlConnection(strConn);

    SqlCommand myCmd = new SqlCommand(strSQL,myCn);

    try

    {

    myCn.Open();

    object r = myCmd.ExecuteScalar();

    if(Object.Equals(r,null))

    {

    throw new Exception("object unavailable!");

    }

    else

    Ҷƪл˵?
  • һƪc#中使用 Win32 和其他库
    һƪ使用C#编写的一个定时关机程序