TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ed
NA
1
5.3k
No mapping exist from object type
Jan 25 2010 9:33 PM
Hello
I am getting this erro that I never had before, any help is appreciated
No mapping exists from object type System.Data.SqlClient.SqlConnection to a known managed provider native type.
My code:
Dim
cmd
As
SqlClient.SqlCommand
Dim
cmdString
As
String
= (
"SELECT [Position] FROM [login] WHERE (([User] = ?) AND ([Password] = ?))"
)
Dim
conn
As
New
SqlClient.SqlConnection(
"Data Source=ED_SDESKTOP\SQLEXPRESS;Initial Catalog=Website;Integrated Security=SSPI"
)
cmd =
New
SqlClient.SqlCommand(cmdString, conn)
cmd.Parameters.Add(
"SELECT [Position] FROM [login] WHERE (([User] = ?) AND ([Password] = ?))"
, conn)
conn.Open()
Dim
myReader
As
SqlClient.SqlDataReader
myReader = cmd.ExecuteReader(CommandBehavior.CloseConnection)
If
myReader.Read()
Then
FormsAuthentication.RedirectFromLoginPage(txtUsername.Text,
False
)
Else
Response.Write(
"Invalid credentials"
)
End
If
myReader.Close()
Reply
Answers (
0
)
problem migrating from vb to vb.net