User Profile
Collapse
-
As I said, it's only a sketch; Inste of "..." is a large code that is irrelevant to my problem so I put "..." insted of it; I put only the code that count, that can cause my problem;... -
this is exactly what i did :) and in the begining I specified what part dont't work; that part alone is irelevant;Leave a comment:
-
problem whit datareader
I have a prpblem with the following code ( a sketch of it); cmd works fine but cmd2 not; Whit query2 I want to extract a value form database but even if the value exist the " if (dr.HasRows) " pass it and go to "else {//}". I hope you will understand what I'm trying to say.
...Code:string query ="select..." string query2 = "select..." MySqlCommand cmd = new MySqlCommand(query, connection);
-
Thanks for the answer;
I manage to solve the problme. Now my ode looks like this:
form query2 i delete the ' ' but query1 looks just as before and works fine; I's strange but it's work;Code:# string query1 = "UPDATE Movie set pret = pret + '" + i + "'"; # string query2 = "UPDATE Movie set pret = pret - " + i + "";
Leave a comment:
-
Error:Index and length must refer to a location within the string.
Hi,
what is rong with my code?
...Code:int i = int.Parse(txtpret.Text); string query1 = "UPDATE Movie set pret = pret + '" + i + "'"; string query2 = "UPDATE Movie set pret = pret - '" + i + "'"; MySqlCommand cmd1 = new MySqlCommand(query1, connection); MySqlCommand cmd2 -
I manage to take the picture form the database but I can't put it in the picturebox because it give an erroar : "A generic error occurred in GDI+."
...Code:MySqlDataReader dr; dr = cmd.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { MemoryStream ms = new MemoryStream((byte[])dr["poza"]);Leave a comment:
-
Thank you, I'll try then to fix the problem.
(I'm from Romania)Leave a comment:
-
I don't know why but my browser can't find the server. An exact answer would be much better than reading some general info about this; I tried that but since I'm a novice, without much results.Leave a comment:
-
I can't open the link. Anyway, befor I post the question i do a lot of reading on this topic but without result. And because of that I post the question, as a last try :)Leave a comment:
-
binding blob with picturebox
Hi,
I'm a beginer in c sharp and I can't pass over a problem. I would like to bind a blob field (mysql) with a picturebox in c sharp;
here is the code:
...Code:string query = "Select name,director,picture from Movies where Movies.name='" + search + "'"; //create command and assign the query and connection from the constructor MySqlCommand cmd = new MySqlCommand(query,Last edited by tlhintoq; May 10 '10, 02:34 PM. Reason: [CODE] ...Your code goes between code tags [/CODE]
No activity results to display
Show More
Leave a comment: