.sdf insert ,retrieve array of string elements
-
Wednesday, March 07, 2012 2:08 AM
hello,
iam using .sdf sql compact for my wpf app, i know how to insert and retrieve data(one string) into this local database but i don't know how to insert fro an array one by one using 'foreach' method ? please help
please
- Edited by SANTANA GEORGE Wednesday, March 07, 2012 4:28 AM
All Replies
-
Thursday, March 08, 2012 3:52 AMModerator
Hi SANTANA,
I don't fully understand your sentence: but i don't know how to insert fro an array one by one using 'foreach' method?
Could you please elaborate a little bit more about it? Do you mean to use array as binding source object? Also, which element you want to bind with?
If you mean to insert array to database, you can try concatenating the foreach statement into the insert syntax.
Have a nice day,
Kee Poppy [MSFT]
MSDN Community Support | Feedback to us
- Edited by Kee PoppyModerator Thursday, March 08, 2012 3:58 AM spell mis
-
Thursday, March 08, 2012 10:08 AM
Sorry
Actually I have a array of strings (string[] myarray ;) it contain strings
i need to send all strings (first to last) to a database
i think
foreach(string s in myarray)
{
myarray[i] // need to save each element in array
//need to know query to do this operation
}
please help me
please
-
Friday, March 09, 2012 5:40 AMModerator
Check this (SQL database for instance):
cmd= new SqlCommand ("insert into table1 values('"+s+"')", con);
cmd.ExecuteNonQuery();Have a nice day,
Kee Poppy [MSFT]
MSDN Community Support | Feedback to us
- Marked As Answer by SANTANA GEORGE Friday, March 09, 2012 6:25 AM
-
Friday, March 09, 2012 5:46 AMThank You Verymuch Sir
- Edited by SANTANA GEORGE Friday, March 09, 2012 5:49 AM
-
Thursday, March 15, 2012 2:20 AMhow to increase speed of my horizontal scrollbar ?
please

