Strict Standards: Only variables should be passed by reference in /var/www/clients/client2/web2/web/includes/arcade/functions_arcade.php on line 604

Strict Standards: Only variables should be passed by reference in /var/www/clients/client2/web2/web/includes/arcade/functions_arcade.php on line 604

Strict Standards: Only variables should be passed by reference in /var/www/clients/client2/web2/web/includes/arcade/functions_arcade.php on line 604
Neofriends.net • View topic - [VB.net] An Offline Login System..Help please:D

It is currently Tue Jul 22, 2014 4:05 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: [VB.net] An Offline Login System..Help please:D
PostPosted: Tue Jun 15, 2010 6:17 pm 
Offline
User avatar
.: Level III :.

Joined: Mon Jan 04, 2010 5:21 pm
Posts: 554
iTrader:
Gender: Male
Cash:90
Reputation point: 34
singapore has a spectacular aura about themsingapore has a spectacular aura about them


Giveaway Donor Award Trader Winner Award

i did a simple login system which make use of a offline database using this tutorial..

http://www.youtube.com/watch?v=p0dcPiLYrck

can anyone help me by adding a new user function to the program?

+rep to anyone that can help me :D

thanks tharoux in advance XD XD

here is the source code.


Attachments:
WindowsApplication1.zip [491.77 KiB]
Downloaded 57 times

_________________
Image


Credits to whoever that have mentioned all these links.

Secret Lab Maps Price Guides Link - http://sunnyneo.com/lab_map_prices.php
Find your Music from TV & Movies Site - http://www.tunefind.com/
Cross-Painted Pets Directory - http://www.neopets.com/~ColtzanIII
Top
 Profile  
 
 Post subject: Re: [VB.net] An Offline Login System..Help please:D
PostPosted: Tue Jun 15, 2010 8:33 pm 
Offline
User avatar
.: Admin :.

Joined: Sat Dec 30, 2006 10:31 pm
Posts: 2733
Location: In front of my PC, Montreal
iTrader:
Highscores: 2
Gender: Male
Cash:3715
Reputation point: 454
tharoux has a reputation beyond repute!tharoux has a reputation beyond repute!tharoux has a reputation beyond repute!tharoux has a reputation beyond repute!tharoux has a reputation beyond repute!tharoux has a reputation beyond repute!tharoux has a reputation beyond repute!tharoux has a reputation beyond repute!tharoux has a reputation beyond repute!tharoux has a reputation beyond repute!tharoux has a reputation beyond repute!tharoux has a reputation beyond repute!tharoux has a reputation beyond repute!tharoux has a reputation beyond repute!tharoux has a reputation beyond repute!


Content Giveaway Donor Award Graphics Trader Winner Award

Hi !
First, some advices... XD

I watched the videos, and you can do all this with ALOT less code.
-By using "Imports System.Data.SqlClient" at the very top of the code, you'll be able to skip all the "sqlClient." in the entire code.
-I traded the "adaptor" for a SqlDataReader, it's lighter and faster to use cause it's read-only

Here's how I would do it. This code assume you use the same table as in the video.
It will add a record (using the "INSERT INTO" sql command) and than show all the records in the database to confirm yours was added.

BTW, executeNonQuery() will return the numbers of record added. Usefull if you add more than one at once.
The executeReader() will return a DataReader, usefull to read the content like I said previously.
Code:
Imports System.Data.SqlClient

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim connection As SqlConnection
        Dim command As SqlCommand
        Dim datareader As SqlDataReader

        connection = New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Members.mdf;Integrated Security=True;User Instance=True")
        connection.Open()
        command = New SqlCommand("INSERT INTO [User] VALUES ('testing1','testing2');", connection)
        command.ExecuteNonQuery()
        command = New SqlCommand("SELECT * FROM [User];", connection)
        datareader = command.ExecuteReader()
        While datareader.Read()
            MsgBox(datareader(0).ToString)
            MsgBox(datareader(1).ToString)
            MsgBox(datareader(2).ToString)
        End While
        datareader.Close()
        connection.Close()
    End Sub
End Class

_________________
My Tutorials/Guides:
[VB.NET] Neopets Programming Tutorial|[CE]: Faerie Bubbles Avatar|[VB.NET]: NF Authorization Solution
[SCAR]: Using Forms|[SCAR]: How to use SCAR - Video|[VB.NET] Neopets Login Form

My Programs:
Attic Buyer|Power Feeder|Accounts Manager|Accounts Checker|Igloo Melter|Maps USAB|Auto Pricer
Tyranu-Evavu Player|Auto-Adopter|Account Age Checker|Grarrl Keno Player|Lever Of Doom Puller
Dice-A-Roo Player|National Neopian Autoplayer|AB Lists Manager|Dar-BLAT!!! Player
The Buzzer Game Player|Dice Escape Player|Zurroball Player

Last 2 trades (of 80):
Sold items to Blessed: Thanks for the trade !
Sold items to supracharger: Thanks for the trade !


Top
 Profile  
 
 Post subject: Re: [VB.net] An Offline Login System..Help please:D
PostPosted: Wed Jun 16, 2010 7:13 am 
Offline
User avatar
.: Level III :.

Joined: Mon Jan 04, 2010 5:21 pm
Posts: 554
iTrader:
Gender: Male
Cash:90
Reputation point: 34
singapore has a spectacular aura about themsingapore has a spectacular aura about them


Giveaway Donor Award Trader Winner Award

lol knew u were gonna be the first..

alright sure..will try it and get back to u once i go on my laptop..(currently using my desktop which is programming-free XD)

Still need the New User function - to the other 3 who dl the file:)..

_________________
Image


Credits to whoever that have mentioned all these links.

Secret Lab Maps Price Guides Link - http://sunnyneo.com/lab_map_prices.php
Find your Music from TV & Movies Site - http://www.tunefind.com/
Cross-Painted Pets Directory - http://www.neopets.com/~ColtzanIII


Top
 Profile  
 
 Post subject: Re: [VB.net] An Offline Login System..Help please:D
PostPosted: Wed Jun 16, 2010 12:50 pm 
Offline
User avatar
.: Admin :.

Joined: Sat Dec 30, 2006 10:31 pm
Posts: 2733
Location: In front of my PC, Montreal
iTrader:
Highscores: 2
Gender: Male
Cash:3715
Reputation point: 454
tharoux has a reputation beyond repute!tharoux has a reputation beyond repute!tharoux has a reputation beyond repute!tharoux has a reputation beyond repute!tharoux has a reputation beyond repute!tharoux has a reputation beyond repute!tharoux has a reputation beyond repute!tharoux has a reputation beyond repute!tharoux has a reputation beyond repute!tharoux has a reputation beyond repute!tharoux has a reputation beyond repute!tharoux has a reputation beyond repute!tharoux has a reputation beyond repute!tharoux has a reputation beyond repute!tharoux has a reputation beyond repute!


Content Giveaway Donor Award Graphics Trader Winner Award

the new user function is in there ;)
You're not expecting someone to give it already made ? it's too easy :maha:

_________________
My Tutorials/Guides:
[VB.NET] Neopets Programming Tutorial|[CE]: Faerie Bubbles Avatar|[VB.NET]: NF Authorization Solution
[SCAR]: Using Forms|[SCAR]: How to use SCAR - Video|[VB.NET] Neopets Login Form

My Programs:
Attic Buyer|Power Feeder|Accounts Manager|Accounts Checker|Igloo Melter|Maps USAB|Auto Pricer
Tyranu-Evavu Player|Auto-Adopter|Account Age Checker|Grarrl Keno Player|Lever Of Doom Puller
Dice-A-Roo Player|National Neopian Autoplayer|AB Lists Manager|Dar-BLAT!!! Player
The Buzzer Game Player|Dice Escape Player|Zurroball Player

Last 2 trades (of 80):
Sold items to Blessed: Thanks for the trade !
Sold items to supracharger: Thanks for the trade !


Top
 Profile  
 
 Post subject: Re: [VB.net] An Offline Login System..Help please:D
PostPosted: Wed Jun 16, 2010 5:49 pm 
Offline
User avatar
.: Level III :.

Joined: Mon Jan 04, 2010 5:21 pm
Posts: 554
iTrader:
Gender: Male
Cash:90
Reputation point: 34
singapore has a spectacular aura about themsingapore has a spectacular aura about them


Giveaway Donor Award Trader Winner Award

LOL !..opps didn't even read the code when i was on my desktop and i misread what u typed :p..

sooo sorry..gonna try that out. will update if i meet with any problem:)..


edited : tried it out..

actually i wan the values to be entered from textbox1 and textbox2 :p..

the values can't be stored into the table? i am able to log in using the values : testing1, testing2 but the table doesn't show these two values in the respective columns..anyway to do that?

2nd edit : ha

Code:
command = New SqlClient.SqlCommand("INSERT INTO [User](Username, Password) VALUES ('" & TextBox1.Text & "', '" & TextBox2.Text & "');", connection)


the program can now add a new username & password temporarily..as specified by me in textbox1 and textbox2..

the problem is that the table won't be updated and after restarting the program, the new user that i created was gone..

_________________
Image


Credits to whoever that have mentioned all these links.

Secret Lab Maps Price Guides Link - http://sunnyneo.com/lab_map_prices.php
Find your Music from TV & Movies Site - http://www.tunefind.com/
Cross-Painted Pets Directory - http://www.neopets.com/~ColtzanIII


Top
 Profile  
 
 Post subject: Re: [VB.net] An Offline Login System..Help please:D
PostPosted: Fri Jun 18, 2010 1:43 pm 
Offline
User avatar
.: Admin :.

Joined: Sat Dec 30, 2006 10:31 pm
Posts: 2733
Location: In front of my PC, Montreal
iTrader:
Highscores: 2
Gender: Male
Cash:3715
Reputation point: 454
tharoux has a reputation beyond repute!tharoux has a reputation beyond repute!tharoux has a reputation beyond repute!tharoux has a reputation beyond repute!tharoux has a reputation beyond repute!tharoux has a reputation beyond repute!tharoux has a reputation beyond repute!tharoux has a reputation beyond repute!tharoux has a reputation beyond repute!tharoux has a reputation beyond repute!tharoux has a reputation beyond repute!tharoux has a reputation beyond repute!tharoux has a reputation beyond repute!tharoux has a reputation beyond repute!tharoux has a reputation beyond repute!


Content Giveaway Donor Award Graphics Trader Winner Award

Sorry, I missed your post because you only edited it.

I don't have VB with me right now but there's an UPDATE function somewhere that should be put before the connection.close() but after the "INSERT INTO".

_________________
My Tutorials/Guides:
[VB.NET] Neopets Programming Tutorial|[CE]: Faerie Bubbles Avatar|[VB.NET]: NF Authorization Solution
[SCAR]: Using Forms|[SCAR]: How to use SCAR - Video|[VB.NET] Neopets Login Form

My Programs:
Attic Buyer|Power Feeder|Accounts Manager|Accounts Checker|Igloo Melter|Maps USAB|Auto Pricer
Tyranu-Evavu Player|Auto-Adopter|Account Age Checker|Grarrl Keno Player|Lever Of Doom Puller
Dice-A-Roo Player|National Neopian Autoplayer|AB Lists Manager|Dar-BLAT!!! Player
The Buzzer Game Player|Dice Escape Player|Zurroball Player

Last 2 trades (of 80):
Sold items to Blessed: Thanks for the trade !
Sold items to supracharger: Thanks for the trade !


Top
 Profile  
 
 Post subject: Re: [VB.net] An Offline Login System..Help please:D
PostPosted: Fri Jun 18, 2010 6:15 pm 
Offline
User avatar
.: Level III :.

Joined: Mon Jan 04, 2010 5:21 pm
Posts: 554
iTrader:
Gender: Male
Cash:90
Reputation point: 34
singapore has a spectacular aura about themsingapore has a spectacular aura about them


Giveaway Donor Award Trader Winner Award

its alright :) ..yeah, i saw that function online before but i tried putting it here and there and it doesn't work..

can u take a look at the program again and maybe tell me where to put it :D ..i tried putting it right before close.connection, doesn't give any error but it still doesn't update the table.

btw, if i were to use the SET function, will it be easier?

i found this online
Code:
UPDATE Persons
SET Address='Nissestien 67', City='Sandnes'
WHERE LastName='Tjessem' AND FirstName='Jakob'


which will give

P_Id LastName FirstName Address City
1 Hansen Ola Timoteivn 10 Sandnes
2 Svendson Tove Borgvn 23 Sandnes
3 Pettersen Kari Storgt 20 Stavanger
4 Nilsen Johan Bakken 2 Stavanger
5 Tjessem Jakob Nissestien 67 Sandnes

meaning if i were to program mine, it would be something like this

Code:
UPDATE [Users]
SET Username='ABC', Password='123'
WHERE ID='?'

what do i put for the ID in order to user and pass under the correct ID number.

oh ya, aha coming on to NF during work !!! XD XD ..


Attachments:
New Folder (2) New.zip [508.85 KiB]
Downloaded 47 times

_________________
Image


Credits to whoever that have mentioned all these links.

Secret Lab Maps Price Guides Link - http://sunnyneo.com/lab_map_prices.php
Find your Music from TV & Movies Site - http://www.tunefind.com/
Cross-Painted Pets Directory - http://www.neopets.com/~ColtzanIII
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
* FAQ

Powered by phpBB © 2000- phpBB Group
NEOPETS, characters, logos, names and all related indicia are trademarks of Neopets, Inc., © 1999-. © denotes Reg. US Pat. & TM Office. All rights reserved.
Website © neofriends.net - this site is in no way affiliated with Neopets, Inc or Viacom International, Inc.

phpBB SEO