![]() |
C# programming help
In my programming class I am trying to make an SQL Database in Microsoft Visual C# 2010 Express using a windows form that would allow you to input data (such as a username and password) into the database.
This is the first time I have messed with SQL and I have no idea what I am doing >.> I am not sure what you would need to know to help me but I will provide the code I have and a SS of the table I have for the database. |
Re: C# programming help
Code:
string sqlquery = "INSTERT INTO [UserTable] (Username, Password) VALUES ('" + UsernameTextBox.Text + "," + "'" + PasswordTextBox.Text + "')"; I don't have any C# knowledge, just pointing the SQL mistype out :p |
Re: C# programming help
I've never tried using SQL with C# but I don't see anything wrong with this simple example other than what velocity pointed out.
You have these lines both on load and when you click register. This is most likely redundant. Code:
string connection = @"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\UserDatabase.mdf;Integrated Security=True;User Instance=True"; |
Re: C# programming help
ok thanks. I will see if that fixes things. I feel so stupid not seeing that mistype x.x
I am in lunch right now and so I won't be able to try it until my next class which is LAN. |
Re: C# programming help
Always check your database queries manually in the MySQL command line. Regardless of OS, get into its CLI and execute:
Code:
mysql -uroot -p Also if they're making you code applications that use databases with zero knowledge of them learn them. It's mind boggling to me why on earth they would do that. Edit: also instead of taking a screen shot in the MySQL CLI you can just use: DESC <tableName> then copy paste. |
All times are GMT -5. The time now is 11:47 PM. |
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright FlashFlashRevolution