Click here to Skip to main content
15,891,033 members
Home / Discussions / C#
   

C#

 
AnswerRe: Number of query values and destination fields are not the same. Pin
mark_w_12-Sep-08 4:35
mark_w_12-Sep-08 4:35 
GeneralA question back to you :p Pin
mark_w_12-Sep-08 4:48
mark_w_12-Sep-08 4:48 
GeneralRe: A question back to you :p Pin
The Cake of Deceit12-Sep-08 5:58
The Cake of Deceit12-Sep-08 5:58 
GeneralRe: A question back to you :p Pin
Vimalsoft(Pty) Ltd12-Sep-08 9:46
professionalVimalsoft(Pty) Ltd12-Sep-08 9:46 
GeneralRe: A question back to you :p Pin
Vimalsoft(Pty) Ltd12-Sep-08 9:49
professionalVimalsoft(Pty) Ltd12-Sep-08 9:49 
GeneralRe: Number of query values and destination fields are not the same. Pin
Vimalsoft(Pty) Ltd12-Sep-08 9:44
professionalVimalsoft(Pty) Ltd12-Sep-08 9:44 
AnswerRe: Number of query values and destination fields are not the same. Pin
Ashfield12-Sep-08 4:35
Ashfield12-Sep-08 4:35 
AnswerRe: Number of query values and destination fields are not the same. Pin
Langa Shabangu12-Sep-08 8:40
Langa Shabangu12-Sep-08 8:40 
Hallo Vuyiswa

Please look at the soluction below I have tested it and it works.

public int Register_User(String Firstname,String LastName,String Username,String Password,String Email)
{
int Res = 0 ;

OleDbCommand cmdinserts;

cmdinserts = new OleDbCommand();

con = new OleDbConnection(strcon);

cmdinserts.CommandText = "insert into [Users]([Firstname],[LastName],[Username],[Password],[Email]) Values(?,?,?,?,?)";

cmdinserts.CommandTimeout = 0;

cmdinserts.CommandType = CommandType.Text;

cmdinserts.Parameters.Add("@Firstname",OleDbType.Char,30).Value = Firstname;

cmdinserts.Parameters.Add("@LastName",OleDbType.Char,30).Value = LastName;

cmdinserts.Parameters.Add("@Username",OleDbType.Char,30).Value = Username;

cmdinserts.Parameters.Add("@Password",OleDbType.Char,30).Value = Password;

cmdinserts.Parameters.Add("@Email",OleDbType.Char,30).Value = Email;

cmdinserts.Connection = con;

try
{
con.Open();

//Res = (int)cmdinsert.ExecuteScalar();
Res = (int)cmdinserts.ExecuteNonQuery();

}
catch (OleDbException)
{
throw;
}
finally
{
con.Close();
}
return Res;
}

Hope this helps.

Ngiyabonga

Langa
GeneralRe: Number of query values and destination fields are not the same. Pin
Vimalsoft(Pty) Ltd12-Sep-08 9:43
professionalVimalsoft(Pty) Ltd12-Sep-08 9:43 
Questionserver is Running or not? Pin
balu1234512-Sep-08 4:11
balu1234512-Sep-08 4:11 
AnswerRe: server is Running or not? Pin
Paul Conrad12-Sep-08 5:37
professionalPaul Conrad12-Sep-08 5:37 
AnswerRe: server is Running or not? Pin
leppie12-Sep-08 5:52
leppie12-Sep-08 5:52 
QuestionReporting of operating system Pin
Matt Fishbeck12-Sep-08 4:10
Matt Fishbeck12-Sep-08 4:10 
AnswerRe: Reporting of operating system Pin
michaelvdnest12-Sep-08 4:38
michaelvdnest12-Sep-08 4:38 
AnswerRe: Reporting of operating system Pin
michaelvdnest12-Sep-08 4:39
michaelvdnest12-Sep-08 4:39 
QuestionUser PC and Server on WAN Pin
balu1234512-Sep-08 4:05
balu1234512-Sep-08 4:05 
AnswerRe: User PC and Server on WAN Pin
Manas Bhardwaj12-Sep-08 4:09
professionalManas Bhardwaj12-Sep-08 4:09 
GeneralRe: User PC and Server on WAN Pin
Paul Conrad12-Sep-08 5:38
professionalPaul Conrad12-Sep-08 5:38 
GeneralRe: User PC and Server on WAN Pin
balu1234515-Sep-08 19:16
balu1234515-Sep-08 19:16 
QuestionData binding to fill data grid view Pin
postonoh12-Sep-08 3:47
postonoh12-Sep-08 3:47 
QuestionSqlConnection open despite no service Pin
franz.pilgerstorfer12-Sep-08 2:02
franz.pilgerstorfer12-Sep-08 2:02 
QuestionNeed Help in Image Mapping Pin
tdeepika12-Sep-08 2:00
tdeepika12-Sep-08 2:00 
AnswerRe: Need Help in Image Mapping Pin
Dewald12-Sep-08 2:52
Dewald12-Sep-08 2:52 
GeneralRe: Need Help in Image Mapping Pin
tdeepika14-Sep-08 20:27
tdeepika14-Sep-08 20:27 
QuestionCompile a project from code, or explanations about CodeDom... Pin
kontax12-Sep-08 1:49
kontax12-Sep-08 1:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.