데이터 집합을 반환하는 메서드를 수행하려고하지만 연결 문자열이 작동하지 않습니다.Visual Studio의 ConnectionString
가 무슨 일이야public DataSet list()
{
// First Create a New Connection
System.Data.SqlClient.SqlConnection sqlConnection1 = new System.Data.SqlClient.SqlConnection();
// Now Pass a Connection String To the Connection
sqlConnection1.ConnectionString = "Data Source=mysite.com.br;User ID=admin_devr;Password=123456;Initial Catalog="rave_dbteste" providerName="System.Data.OleDb";
// Now the Select statement you want to run
string select = "select * from table";
// Create an Adapter
SqlDataAdapter da = new SqlDataAdapter(select, sqlConnection1);
// Create a New DataSet
DataSet ds = new DataSet();
// Fill The DataSet With the Contents of the Stock Table
da.Fill(ds, "cdestacionamento");
// Now Return ds which is a DataSet
return (ds);
}
:
나는이 봤어?
같은 체크를 넣어 다음 연결 문자열 쓰기의 라인 후 연결을 열지 않았다고 생각? – Habibillah
무슨 오류가 있습니까? 또한 닫는 방법이 없다고 생각합니다. "(따옴표) 그리고 항상 web.config 또는 app.config에 연결 문자열을 넣으십시오. –
따르기 좋은 링크 : http://www.connectionstrings.com/sql-server -2012 –