Click here to Skip to main content
15,881,380 members
Home / Discussions / C#
   

C#

 
AnswerKey-logger Pin
fly90428-Jun-09 0:10
fly90428-Jun-09 0:10 
QuestionRe: keystroke monitor Pin
musefan29-Jun-09 2:45
musefan29-Jun-09 2:45 
AnswerRe: keystroke monitor Pin
EliottA29-Jun-09 3:32
EliottA29-Jun-09 3:32 
QuestionConnection Of Database during installing SETUP Pin
rhtbhegade27-Jun-09 20:32
rhtbhegade27-Jun-09 20:32 
AnswerRe: Connection Of Database during installing SETUP Pin
Arindam Sinha27-Jun-09 22:18
Arindam Sinha27-Jun-09 22:18 
QuestionUnable to Save Array values in database Pin
googlejumbo27-Jun-09 19:24
googlejumbo27-Jun-09 19:24 
AnswerRe: Unable to Save Array values in database Pin
Henry Minute28-Jun-09 8:01
Henry Minute28-Jun-09 8:01 
GeneralRe: Unable to Save Array values in database Pin
googlejumbo28-Jun-09 20:24
googlejumbo28-Jun-09 20:24 
Thanks for your Prompt Reply sir

I have made the changes in the code as you have suggested as shown:

SqlConnection con = new SqlConnection();
con.ConnectionString = "Data Source=localhost;Initial Catalog=InkDb;Integrated Security=True;Persist Security Info=True;Packet Size=4096";
string qry = "Insert into beziertable values(@strokeIndex,@cuspIndex,@BezierCusp)";
SqlCommand sqlInsertCmd = new SqlCommand(qry, con);
sqlInsertCmd.CommandText = qry;
sqlInsertCmd.CommandType = CommandType.Text;
int count;
int i;
sqlInsertCmd.Parameters.AddWithValue("@strokeIndex", mInkoverlay.Ink.Strokes.IndexOf(stroke));
int cus;
cus = Convert.ToInt16(stroke.BezierCusps.GetValue(0));
sqlInsertCmd.Parameters.AddWithValue("@cuspIndex", cus);
// I have made the changes by making declaration outside the loop as sqlInsertCmd.Parameters.AddWithValue("@BezierCusp", val);//My loop works acuurate But as my loop execute i<=100 times and it come out of loop and the value which my variable "val" carry will get inserted into the database , but i want all the values of "val" for each iteration till i=0 to i>=100, But the last value of "val" get inserted , i dont want this , i want all the values of array of the Stroke.GetPoint(i).X. Please suggest me the solution to rectify the Problem///
for (i = 0; i <=100 i = i + 1)
{

val=stroke.GetPoint(i).X;

}

sqlInsertCmd.Parameters.AddWithValue("@BezierCusp", val);
//Only last value which i get in "val" after loop completes get Inserted into Database , but i want all the values to be inserted into database , how i can do this please suggest how should i rectify the problem...//
sqlInsertCmd.Connection = con;
SqlDataAdapter sqlDataAdapter3 = new SqlDataAdapter();
sqlDataAdapter3.InsertCommand = sqlInsertCmd;
con.Open();
sqlInsertCmd.ExecuteNonQuery();
con.Close();

Thanks alot sir, waiting for your response
with regards
Genius
GeneralRe: Unable to Save Array values in database Pin
Henry Minute28-Jun-09 21:55
Henry Minute28-Jun-09 21:55 
GeneralRe: Unable to Save Array values in database Pin
googlejumbo28-Jun-09 22:22
googlejumbo28-Jun-09 22:22 
GeneralRe: Unable to Save Array values in database Pin
Henry Minute29-Jun-09 6:06
Henry Minute29-Jun-09 6:06 
QuestionLeading zero in hex formatting Pin
Trollslayer27-Jun-09 11:56
mentorTrollslayer27-Jun-09 11:56 
AnswerRe: Leading zero in hex formatting Pin
Christian Graus27-Jun-09 12:01
protectorChristian Graus27-Jun-09 12:01 
AnswerRe: Leading zero in hex formatting Pin
Ed.Poore27-Jun-09 12:01
Ed.Poore27-Jun-09 12:01 
GeneralRe: Leading zero in hex formatting Pin
Christian Graus27-Jun-09 12:18
protectorChristian Graus27-Jun-09 12:18 
GeneralRe: Leading zero in hex formatting Pin
Luc Pattyn27-Jun-09 12:31
sitebuilderLuc Pattyn27-Jun-09 12:31 
GeneralRe: Leading zero in hex formatting Pin
Christian Graus27-Jun-09 12:38
protectorChristian Graus27-Jun-09 12:38 
GeneralRe: Leading zero in hex formatting Pin
Ed.Poore27-Jun-09 14:01
Ed.Poore27-Jun-09 14:01 
GeneralRe: Leading zero in hex formatting Pin
Luc Pattyn27-Jun-09 15:07
sitebuilderLuc Pattyn27-Jun-09 15:07 
GeneralRe: Leading zero in hex formatting Pin
Ed.Poore27-Jun-09 23:47
Ed.Poore27-Jun-09 23:47 
GeneralRe: Leading zero in hex formatting Pin
Trollslayer27-Jun-09 13:53
mentorTrollslayer27-Jun-09 13:53 
GeneralRe: Leading zero in hex formatting Pin
Ed.Poore27-Jun-09 14:00
Ed.Poore27-Jun-09 14:00 
GeneralRe: Leading zero in hex formatting Pin
Trollslayer27-Jun-09 14:13
mentorTrollslayer27-Jun-09 14:13 
JokeRe: Leading zero in hex formatting Pin
Christian Graus27-Jun-09 14:21
protectorChristian Graus27-Jun-09 14:21 
GeneralRe: Leading zero in hex formatting Pin
Luc Pattyn27-Jun-09 14:04
sitebuilderLuc Pattyn27-Jun-09 14:04 

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.