这次做一个项目。用c#连接各种各样的数据库。为了连接数据库,我一个一个的做测试。后来发现是一篇连接数据库的文章。既然如此,我就写在博客上了。
首先,连接sqlsever2000
SqlConnection thisConnection = new SqlConnection( @" Server=127.0.0.1;uid=sa;pwd=123;database=Test " );
thisConnection.Open();
// create commond for this connection
SqlCommand thisCommand = thisConnection.CreateCommand();
thisCommand.CommandText = " select * from USER_ACCOUNT " ;