Tech
Forums
Jobs
Books
Events
Videos
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
2
Answers
Cannot implicitly convert type 'System.Data.Odbc.OdbcConnection' to 'System.Data.SqlClient.SqlConnection'
Chevy Mark Sunderland
12y
4k
1
Reply
Hi there, I hope your help.
I try this statement in asp net, but receive this alert, can you help me?
thanks in advance.
Server Error in '/' Application.
Compilation Error
Description:
An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message:
CS0029: Cannot implicitly convert type 'System.Data.Odbc.OdbcConnection' to 'System.Data.SqlClient.SqlConnection'
Source Error:
Line 42: conn.Open(); Line 43: cmd.CommandText = sSQL;
Line 44: cmd.Connection = conn;
Line 45: SqlDataReader dr; Line 46: dr = cmd.ExecuteReader(System.Data.CommandBehavior.CloseConnection);
Attachment:
codes.zip
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
Display video in asp.net 4.0
Click avent on a menu link item to trigger a sql select sproc that will display results on a webform data grid