79 Replies
I dotted out the credidentals but they should be ok
Whenever I click the button to execute, I get this exception:
System.InvalidOperationException: 'Internal connection fatal error.'
On the line
*Any help is appreciated and I will read anything that will be there after my training sessions ❤️ *
there is probably something about my connectionString I just can't figure it out
Your connectionString has the wrong format
can you please help me with it? 😅
the credidentals after the equal signs arent in parentheses
it's just how i dotted it
Here is an explanation on how to build it correctly with some examples
isnt that exactly my connection string tho?

BTW, wtf did you do?
server and data source are the same thing

xdd
thats just what i set

Ooh, 😂😂
so back to the question, isnt my connectionString the same as the one u sent me?
its just that my server(Data Source) has a port
What does sql7.freesql(..) return?
Thats what i used when i logged into myadmin
Can you put a breakpoint before the using(... And check what's the value of connectionString
I will, I'm in my car, I'll train an hour or so I gotta clear my head
But yes of course I'll be able to do that
Same lol
Do you have the brackets around the sql7.freesql(...)?
No
Do I need it? It has no spaces in it
If you are not putting the value directly, but getting from a method, it should be something like : connectionString = $"Datasource= {a variable or method}, {variable that contains the port number};...
Is that what you have / are missing?
I directly put the values, they aren't in variables
Do you mean that the adress returns the value, so I need to treat it as a variable?

okay
it is giving adifferent error but at least it is sql related now
Try removing the brackets
I thought sql7 was a class and freesql... a property of that class containing the actual data source
i wrote a simple nodejs script and it works so its a syntax problem for sure
freesql? never heard of it
it makes you a 5mb mysql database
im just tinkering with it
it works with the node script
(...) are credidentals dotted out
but this nodejs script works fine
it inserts the values
so its just a syntax error somewhere ig
ah so its mysql ?
yes
try this link https://www.connectionstrings.com/mysql/
MySQL connection strings - ConnectionStrings.com
Connection strings for MySQL. Connect using MySqlConnection, MySQLDriverCS, SevenObjects MySqlClient, Devarts MySqlConnection, MySQLProv.
thanks
System.ArgumentException: 'Keyword not supported: 'port'.'
how did u write it?
password is visible here too lol
idk why i do this xd
like i care lol im just stupid af so
well anyone can probably wipe ur database now
the database with 0 data lul
okay then
maybe u need to put a space after each
;
?nope
it doesnt like port
it instantly throws the exception
.
u sure thats a mysql database?

try others
u have plenty of connection strings to try in that link
this one is related to MySqlDriverCS
ive found this
also what is Database 3306, is this how u called ur db?
thats just a typo its fixed already
thats for microsoft sql server
ohh i got it working
i had to uninstall the basic sql package because something conflicted with the mysql package
ah shouldve asked you what exception it throws
reading the exception message is very important
i read it
i was like wait there are multiple sql packages installed let me just remove one
do i refer to variables with @ ?
like
@adress
etc?
okay it works but
it said "value id cannot be null"
the debugger shows it isnt null
"MySql.Data.MySqlClient.MySqlException: 'Column 'date' cannot be null'"

and yet when i try to insert this id variable:

im trying to convert the datetime from c# into mysqls datetime format
where are u trying to insert?
yes, prefer to use parameterized queries
well the debugger shows the values but only nulls get inserted
well i dont know how ur code looks to judge
cmd.Parameters exists tho
ok im dumb
i did everything OUTSIDE USING
u can pass a DateTime value to idp literally
would this work?
i have a nodejs script again to test if the sql is correct and it returns some weird thing, not only the integer but so much more
if you looked at the microsoft docs of ExecuteNonQuery
or if you hovered your mouse on the method
it will tell u that this method returns
the number of rows affected.
huh okay
ur looking for ExecuteScalar();
returns the first column of the first row in the resultset returned by the query
ur select max would return only 1 row 1 column anyway
like that?
yeah
thanks
im just incremeting the id so i can have a key in the db
why do that? just make the id column autoincrement
and the database will increment it for you
is there such thing?
yes
im glad we didnt learn anything about sql 😄
glad? that sounds sad
sarcasm
lol
can i do the auto increment thing on phpmyadmin?
you probably can
yeah i can
how do i close a thread?