ASP.NET入门 - 连接数据库
2023-12-19 01:52:49    55    0    0
admin

string constr = "server=.;database=master;uid=sa;pwd=";

SqlConnection conn = new SqlConnection(constr);
conn.Open();

SqlCommand cmd = new SqlCommand("select name from sysdatabases", conn);
SqlDataReader sdr = cmd.ExecuteReader();
while (sdr.Read())
{
        Response.Write("<br>" + sdr.GetString(0));

}

Pre: 没有更多

Next: ASP.NET入门 - SqlHelper类

55

ICP备案号: 赣ICP备2020012703号-1

表格内容