Every time I pressed the "Test SQL" button named btnTest, I recieve the error message "Fill: SelectCommand.Connection has not been initialized", although the line "resultsAdapter.SelectCommand = resultsCommand;" is correct. How do I resolve this issue? Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard. Confindential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
public SqlDataAdapter ExecuteQuery_GetAdapter(String SPName, List<SqlParameter> paramList) { cmd = new SqlCommand(); PrepareCommand(cmd, SPName, paramList); SqlDataAdapter da = new SqlDataAdapter(); da.SelectCommand = cmd; CloseConnect(); return da; } public SqlDataAdapter getAllStudent() { DBHelper helper = new DBHelper(); SqlParameter param; SqlDataAdapter da = new SqlDataAdapter(); List<SqlParameter> paramList= new List<SqlParameter>(); return helper.ExecuteQuery_GetAdapter("st_getAllStudent", paramList); } private void StudentForm_Load(object sender, EventArgs e) { da = stdBLL.getAllStudent(); da.Fill(ds, "Students"); dt = ds.Tables["Students"]; Display(); } public void Display() { dataGridView1.DataSource = dt; } Mong mọi người giúp đỡ nhé Nó báo lỗi chỗ dòng Fill ý...=.=! chán đời quá k bik sao nữa.... Được sửa bởi zZzPC-NODzZz lúc 21:24 ngày 08-09-2010 -
conn.Close(); } Có vẻ như chả ai code n-layer mấy!!!!chả thấy ai fix dùm Được sửa bởi zZzPC-NODzZz lúc 23:06 ngày 08-09-2010 -
[=========> Bổ sung bài viết <=========] Bạn đã mở kết nối nhưng lại không trỏ kết nối cho selectcommond Được sửa bởi hoangvansang lúc 11:13 ngày 09-09-2010Reason: Bổ sung bài viết -BookmarksBookmarksQuy định
Quy định DDTH.com |