koopa
koopa
CC#
Created by koopa on 12/18/2022 in #help
❔ ContextSwitchDeadlock
The "long" function is called under "form1_load"
6 replies
CC#
Created by koopa on 10/19/2022 in #help
Collection was modified enumeration operation may not execute
Didn't really understand how references worked
5 replies
CC#
Created by koopa on 10/19/2022 in #help
Collection was modified enumeration operation may not execute
Yeah you're right it fixed when I set it to a copy, thank you
5 replies
CC#
Created by koopa on 10/19/2022 in #help
Collection was modified enumeration operation may not execute
The "msglist" does not get modified during the for loop at all
5 replies
CC#
Created by koopa on 10/7/2022 in #help
SQL and Visual Studio Retrieving a Table
And then get the ID of this new user, however I get this error:
System.Data.SqlClient.SqlException: 'Column name or number of supplied values does not match table definition.'
System.Data.SqlClient.SqlException: 'Column name or number of supplied values does not match table definition.'
18 replies
CC#
Created by koopa on 10/7/2022 in #help
SQL and Visual Studio Retrieving a Table
I'm trying to add username password and email to my users table
18 replies
CC#
Created by koopa on 10/7/2022 in #help
SQL and Visual Studio Retrieving a Table
Thank you moving it off one drive worked - I have one more and hopefully final issue:
SqlCommand cmd = new SqlCommand("insert into Users values(@username,@password,@email)", cn);
cmd.Parameters.AddWithValue("username", info["username"]);
cmd.Parameters.AddWithValue("password", encryptedPW);
cmd.Parameters.AddWithValue("email", info["email"]);
int id = (int)cmd.ExecuteScalar();
SqlCommand cmd = new SqlCommand("insert into Users values(@username,@password,@email)", cn);
cmd.Parameters.AddWithValue("username", info["username"]);
cmd.Parameters.AddWithValue("password", encryptedPW);
cmd.Parameters.AddWithValue("email", info["email"]);
int id = (int)cmd.ExecuteScalar();
18 replies
CC#
Created by koopa on 10/7/2022 in #help
SQL and Visual Studio Retrieving a Table
the file path is really stupid because its a folder in tons of folders because of extracting/sending to zip all the time
18 replies
CC#
Created by koopa on 10/7/2022 in #help
SQL and Visual Studio Retrieving a Table
cn.ConnectionString = @"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C: \Users\username\OneDrive\Documents\Computing NEA Project Current(DB EDIT)\Computing NEA Project Current\Computing NEA Project Current\Computing NEA Project Current\Client Chat App\Client Chat App\Database1.mdf;Integrated Security=True";
18 replies
CC#
Created by koopa on 10/7/2022 in #help
SQL and Visual Studio Retrieving a Table
thanks both of you I think I've got datareader working now - however, and probably more importantly, whenever I try to open a SqlConnection I get an error
An attempt to attach an auto-named database for file "path" failed. A database with the same name exists or specified file cannot be opened or is located on UNC share
An attempt to attach an auto-named database for file "path" failed. A database with the same name exists or specified file cannot be opened or is located on UNC share
I'm not sure what's going wrong here as you can tell Im not experienced with SQL at all and have just followed a basic tutorial to setup a small database alongside my c# code, the file path seems to be correct..?
18 replies
CC#
Created by koopa on 10/7/2022 in #help
SQL and Visual Studio Retrieving a Table
Thank you !
18 replies
CC#
Created by koopa on 9/23/2022 in #help
Disconnect a client from a TCPServer csharp
Thank you all for the methods, sorry for not replying earlier
7 replies
CC#
Created by koopa on 9/14/2022 in #help
Not sure how the byte[] works in Csharp
Sure thank you very much for the help - I'll look for alternatives to binary formatter
9 replies
CC#
Created by koopa on 9/14/2022 in #help
Not sure how the byte[] works in Csharp
Ah okay this makes sense - is there any way of directly converting any data structure to bytes or will it be in its own format like bf?
9 replies