reading database

doesn't read datalist

Page 1 of 1

3 Replies - 1299 Views - Last Post: 28 March 2008 - 06:46 PM Rate Topic: -----

#1 rikki_max   User is offline

  • D.I.C Head
  • member icon

Reputation: 0
  • View blog
  • Posts: 56
  • Joined: 19-April 07

reading database

Posted 28 March 2008 - 06:07 PM

hi i cannot get a system where asp.net (vb.net) will read a msaccess database heres my code:

		On Error Resume Next
		Dim li = DataList1.Items
		Dim key As String
		If My.Request.Cookies.GetKey("user") = Nothing Then
			My.Response.Cookies("user").Value = ""
			My.Response.Cookies("pwsd").Value = ""
		End If
		Label2.Text = "guest"
		LinkButton1.Enabled = False
		HyperLink3.Enabled = False
		For Each key In li
			Label1.Text = key
			If My.Request.Cookies("user").Value = key Then
				If My.Request.Cookies("pwsd").Value = "me" Then
					Label2.Text = "rikki"
					LinkButton1.Enabled = True
					HyperLink3.Enabled = True
					Dim user As HttpCookie = New HttpCookie("user")
					user.Value = key
					user.Expires.AddDays(2)
					Response.Cookies.Set(user)
					Dim pwsd As HttpCookie = New HttpCookie("pwsd")
					pwsd.Value = "me"
					pwsd.Expires.AddDays(2)
					Response.Cookies.Set(pwsd)
				End If
			Else
			End If
		Next


key doesn't equal anything so what it does it hunt through a database finds a user than checks if that user exists
later it will check the password as well with that user.

Is This A Good Question/Topic? 0
  • +

Replies To: reading database

#2 PsychoCoder   User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1659
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: reading database

Posted 28 March 2008 - 06:11 PM

I don't see any code where you're attempting to either connect to the database or retrieve data from it?
Was This Post Helpful? 0
  • +
  • -

#3 rikki_max   User is offline

  • D.I.C Head
  • member icon

Reputation: 0
  • View blog
  • Posts: 56
  • Joined: 19-April 07

Re: reading database

Posted 28 March 2008 - 06:21 PM

i should have explained better i have a list box which has the content i need to validate user and it is called listviewbox1 so that is what i need if i use this system other wise just say another way please
Was This Post Helpful? 0
  • +
  • -

#4 PsychoCoder   User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1659
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: reading database

Posted 28 March 2008 - 06:46 PM

You can have all the data you like in your ListBox, but without instantiating (creating) an OleDbConnection object, an OleDbCommand object, and tell it what to execute you're not going to get anything.

Read this tutorial on OleDb Basics in VB.Net and it will guide you in the direction you need to go :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1