[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.0

How do you use the SQLDataSource object in the VB code behind module?

Asked by monacoassociates in Visual Basic Programming, Visual Studio

Tags: sqldatasource, vb

I am trying to upgrade a website from Visual Studio 2003 to VS 2005, taking advantage of some of the new controls and features available.  In the VS 2003 version, I am accessing data in the VB code using a connection object.  In the VB 2005 version, I would like to create an SQLDataSource object in design view.  My question is, how do I get a look at the data in the VB code behind module in order to code against it?  

For exampe, I have the following code in my Visual Basic code behid module:
Dim conn As OleDbConnection = New OleDbConnection(System.Configuration.ConfigurationManager.AppSettings("ConnectionString"))
Dim cmd As New OleDbCommand(loginSQL, conn)
Dim dbReader As OleDbDataReader
conn.Open()

Try
   dbReader = cmd.ExecuteReader()

   If dbReader.Read Then
      If (dbReader.GetBoolean(dbReader.GetOrdinal("Hide"))) Then
         lblErrorMsg.Text = "Your EC3 account has been deactivated.  Please see your EC3 administrator."
         lblErrorMsg.Visible = True
         Exit Sub
      End If
      Session("SSN") = (dbReader.GetString(dbReader.GetOrdinal("Social Security Number")))
      Session("UserName") = (dbReader.GetString(dbReader.GetOrdinal("Full Name")))
      Session("Security") = (dbReader.GetString(dbReader.GetOrdinal("Security")))
      Session("Access") = (dbReader.GetBoolean(dbReader.GetOrdinal("All Consumers")))
     dbReader.Close()
      conn.Close()
      checkPrefs()
      blErrorMsg.Visible = False
      Response.Redirect("testform.aspx")
Else
   lblErrorMsg.Text = "User Name and/or Password invalid."
   lblErrorMsg.Visible = True
   dbReader.Close()
   conn.Close()
End If
Finally
   conn.Close()
End Try

How can I do this using the SQLDataSource I have set up to execute the SQL?
[+][-]06/26/07 11:04 AM, ID: 19366246Accepted Solution

Your question has an Asker Certified™ answer! monacoassociates verified that this solution worked for them--which means it will likely work for you, too. Click to view the solution free for 30-days now.

About this solution

Zones: Visual Basic Programming, Visual Studio
Tags: sqldatasource, vb
Sign Up Now!
Solution Provided By: traxion
Participating Experts: 1
Solution Grade: A
 
[+][-]06/25/07 01:24 PM, ID: 19358873Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/26/07 10:25 AM, ID: 19365908Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06/26/07 11:11 AM, ID: 19366292Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/26/07 01:22 PM, ID: 19367516Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06/26/07 02:29 PM, ID: 19367994Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/26/07 02:45 PM, ID: 19368121Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06/27/07 06:48 AM, ID: 19372178Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/11/07 02:19 PM, ID: 19677132Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]08/18/07 12:52 PM, ID: 19723599Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]08/22/07 05:50 PM, ID: 19750738Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20100308-EE-VQP-140
Your technology problems solved.
Close See Plans and Pricing. Try it FREE for 30 days.