|
Hi,
i've got a problem when i tried to INSERT details to OLEDB Access.
this is my code:
<pre>
public class registrationClass
{
static string connStr = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\WebSites\DB\users.mdb;Persist Security Info=True";
public static string details(string username, string pass, string email)
{
string input;
//bool Enter = true;
OleDbConnection conn = new OleDbConnection(connStr);
conn.Open();
input = String.Format(@"INSERT INTO userAuth (user,password,Email) VALUES ('{0}','{1}','{2}')", username, pass, email);
OleDbCommand cmd = new OleDbCommand(input, conn);
cmd.ExecuteNonQuery();
conn.Close();
return String.Format("Done");
}
</pre>
now, when i searched on the web, i saw that my query is well.
when i did debug to this action, the input looks like:
"INSERT INTO userAuth (user,password,Email) VALUES ('Igor','pass123','igor@email.com')"
whats wrong????????
thank u!!!
|
|
|
|
|
Ido Shahar wrote: i've got a problem
Do you? which problem? what are the symptoms? does it compile? does it run? does it throw an exception?
which exception? at what line? does your SQL statement work for you when entered in Access itself?
|
|
|
|
|
|
You right, i didnt write any descriptions of symptoms.
i've got an Exception about "Syntax error in INSERT INTO statement"
in Line "cmd.ExecuteNonQuery();"
10x
|
|
|
|
|
When you enter the exact error message ("Syntax error in INSERT INTO statement") in Google, the first hit explains what is wrong.
So learn to Google, it often solves your problem in a matter of seconds.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
wtf!
it wasnt necessary to say what u said.
i have googled it, and also tried to changed password to [password] but also, i've got an exception!
bye
|
|
|
|
|
|
is it a PebkacException?
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
ok, I got it!!!!
the problem was the column names and the way of writing.
the fixed is:
<code>
input = @"INSERT INTO userAuth ([user], [pass], [mail]) VALUES ('" + username + "', '" + pass + "', '" + email + "') ";
</code>
and the parameters that i sending is after casting ToString(), also, in the DB i changed the Column rule to string and not email column as i defined before.
thanks to everyone.
ido.
|
|
|
|
|
I have written a c# win application . I want it to be a service application .
Actually , I want it to be a part of widows services . How can I do this?
|
|
|
|
|
|
Let me ask again : is there any way to make an existing solution to run as a service , I mean before any user logged on windows.
|
|
|
|
|
Generally not if it has a UI. But try using a Windows Scheduled Task.
|
|
|
|
|
I have written an application in c# and want it to be on top of all the other applications in the windows.
I've tried topmost property ,but it's only usefull in the application not in the windows!
How can I do this?
|
|
|
|
|
It works for me when I set the form's topmost property to true, my form is then always on top
|
|
|
|
|
I think you misunderstood me. For example : I open one of my forms
then open the mycomputer or office program. This is where I need my project to be on-top of office. Also, my application comprises many dialog forms.
|
|
|
|
|
That would be user-hostile, not many users would want your application to do that so they wouldn't use it.
|
|
|
|
|
There's a segment of code in c# to change the magnitude of first columns of rows of a dataset, but it doesn't
work!
for (int i = 0; i < objDataSet.Tables[0].Rows.Count ; i++)
objDataSet.Tables[0].Rows[i].ItemArray[0] = i + 1;
how can I change the magnitude of the data in a dataset or dataview ?
|
|
|
|
|
I want to change the pixel format of any image
eg. i wanna change rgb image to greyscale
plz help me to do so
|
|
|
|
|
Seach the articles for "Image processing for dummies" and you'll find an great example by Christian Graus.
|
|
|
|
|
RGB->Gray is transformed as
Gray = (R+G+B)/3;
Bear in might it's a lossy filter, three channels end up being one. Sometimes the RGB values are weighted to make green lighter and blue darker.
|
|
|
|
|
It's commonly done like this:
Gray = 0.3*R+0.59*G+0.11*B;
Cheers,
Drew.
|
|
|
|
|
i want to get selected item in arraylist from chekbox list. For that i want to CHECK whether item is selected or not.
|
|
|
|
|
Do you have your checkbox's in their own collection? If not, you made your job harder.
|
|
|
|
|
Hi Have a good day ....
I hope you will help me to solve this problem .. in my C# Windows Application Form
I have Three Froms
MainFrom -- Has Two Buttons
Btn1 Show From1
Btn2 Show Form2
---------------------
From1 Has TextBox
---------------------
From2 Has PictureBox
---------------------
- I press Btn1 , and From1 Show up ....
- I press Btn2 , and From2 Show up ....
I want , a way that when I write an image path in From1 Textbox
then Fom2 PictureBox Display it ...
I don't want to do this by timers , I wounder if there is way like delegate ? or something ?
thank in advance ...
I know nothing , I know nothing ...
|
|
|
|