Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

[SOLVED] Vb.net Mysql Info To Label Instead Of Datagridview

VB.NET vb .net label datagridview gridview mysql grid

  • This topic is locked This topic is locked
20 replies to this topic

#13 papabear

papabear

    CC Devotee

  • Senior Member
  • PipPipPipPipPipPip
  • 472 posts
  • Location:DarkSide

Posted 15 April 2012 - 01:18 AM

Wow, thanks alot, now i just gotta make the login system, I also want to show other info than energy but I will be able to do that on my own.

Thanks alot :)


You're always welcome Niell and good luck into what you are doing.. :)
  • 1
Life has no CTRL+Z
Never Forget To HIT "LIKE" If I Helped

#14 Niell

Niell

    CC Newcomer

  • Member
  • PipPip
  • 11 posts
  • Location:Belgium

Posted 15 April 2012 - 01:25 AM

Ok, i got it working, i changed it so it uses the name as validation as the user doesnt know their ID.

I uses this on button click:
PlayerName = TextBox2.Text

and this:
Dim query As String = "SELECT my_energy FROM members WHERE playername = '" & PlayerName & "'"

which is working fine, so it uses the Name as validation now.

I want them to enter there password aswell and the name and password have to be correct before it shows their info.

Is that possible? And how would I do this?

Thanks alot
  • 0

#15 papabear

papabear

    CC Devotee

  • Senior Member
  • PipPipPipPipPipPip
  • 472 posts
  • Location:DarkSide

Posted 15 April 2012 - 01:30 AM

Ok, i got it working, i changed it so it uses the name as validation as the user doesnt know their ID.

I uses this on button click:

PlayerName = TextBox2.Text

and this:
Dim query As String = "SELECT my_energy FROM members WHERE playername = '" & PlayerName & "'"

which is working fine, so it uses the Name as validation now.

I want them to enter there password aswell and the name and password have to be correct before it shows their info.

Is that possible? And how would I do this?

Thanks alot


yes that is possible you just have to add some more condition into your query , you can make use of "AND" to add a condition into your query

example

1 = 1 and 0 = 0 : true
1 = 0 and 0 = 0 : false

2 condition must be true so that the whole condition will become true, here's your query


Dim query As String = "SELECT my_energy FROM members WHERE playername = '" & PlayerName & "' AND playerpassword = '" & PlayerPass & "'"

notice how I use "AND" :) and be sure to create a textbox and a variable for your password.. in this example i use "PlayerPass"
  • 1
Life has no CTRL+Z
Never Forget To HIT "LIKE" If I Helped

#16 Niell

Niell

    CC Newcomer

  • Member
  • PipPip
  • 11 posts
  • Location:Belgium

Posted 15 April 2012 - 01:32 AM

Oh, is it that simple :D, Thanks, just new to MySql .. You are a great help. Think i can go on my own from now :)
  • 0

#17 papabear

papabear

    CC Devotee

  • Senior Member
  • PipPipPipPipPipPip
  • 472 posts
  • Location:DarkSide

Posted 15 April 2012 - 01:35 AM

Oh, is it that simple :D, Thanks, just new to MySql .. You are a great help. Think i can go on my own from now :)


I'm happy to help, and I will guess that you are developing something like a game? that's exciting! keep it up
  • 0
Life has no CTRL+Z
Never Forget To HIT "LIKE" If I Helped

#18 Niell

Niell

    CC Newcomer

  • Member
  • PipPip
  • 11 posts
  • Location:Belgium

Posted 15 April 2012 - 01:36 AM

Making a program for a browser game, www.hooligans-world.com ..
  • 0

#19 papabear

papabear

    CC Devotee

  • Senior Member
  • PipPipPipPipPipPip
  • 472 posts
  • Location:DarkSide

Posted 15 April 2012 - 01:38 AM

Making a program for a browser game, www.hooligans-world.com ..


I just checked the website and I love how you do the navigation and transitions from one page to another.. good one :)
good luck
  • 0
Life has no CTRL+Z
Never Forget To HIT "LIKE" If I Helped

#20 Niell

Niell

    CC Newcomer

  • Member
  • PipPip
  • 11 posts
  • Location:Belgium

Posted 15 April 2012 - 01:55 AM

Its my friends game. I just do his program =)

Edit: How do i show a msgbox when the password is wrong? It just doesnt show the energy now when it's wrong.
  • 0

#21 Roger

Roger

    Skadoosh!

  • Administrator
  • 1222 posts
  • Programming Language:C, PHP
  • Learning:Others

Posted 06 May 2012 - 04:13 PM

This topic has been marked as SOLVED. If you have a similar topic, please start a new thread and reference this thread to continue discussions.
  • 0

New around here? Click here to register and start participating in under a minute?

Or do a quick search and you may find the answer you're looking for.






Also tagged with one or more of these keywords: VB.NET, vb, .net, label, datagridview, gridview, mysql, grid

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download