ASP.net页面实现MSSQL数据库的创建和操作,是库创建!
/// <summary>
/// 创建数据库。
/// </summary>
/// <param name="srvName">表示要连接的服务器名</param>
/// <param name="dbName">指定要创建的数据库名</param>
private string CreateDB(string srvName, string dbName)
{
SQLDMO.Application sqlApp = new SQLDMO.ApplicationClass();
SQLDMO.SQLServer srv = new SQLDMO.SQLServerClass();
srv.Connect(srvName, "sa", "");
// 新建数据库名(包括路径)
string dbPath = srv.Registry.SQLDataRoot + "\\DATA\\" + dbName;
bool DBExist = false;
foreach (SQLDMO.Database db in srv.Databases)
{
if (db.Name == dbName)
{
DBExist = true;
}
}
&nbs
相关文档:
public class DBHelper
{
private static SqlConnection connection;
public static SqlConnection Connection
{
&nb ......
Introduction
Before explaining cache management in ASP.NET, let me clarify that different people use different terms for explaining the same concept i.e. managing data. Some people refer to it as state management and some others refer to it as cache management. I love to use the term cache manageme ......
SqlConnection conPortal = new SqlConnection(CommunityGlobals.ConnectionString);
SqlCommand cmdAdd = new SqlCommand( "Community_Disc ......
这几天一直在围绕ASP.NET MVC进行学习,虽然之前接触了一些,但是还没有这么系统的做过相关的测试学习,在最后对其进行总结,希望对于初学MVC的人都有所帮助。
现在将ASP.NET MVC的一系列文章整理如下:
1、【ASP.NET专题】(1)——ASP.NET MVC初探:
http://blog.csdn.net/rocket5725/archive/2010/01/11/5177 ......