Click here to Skip to main content
15,889,216 members
Home / Discussions / C#
   

C#

 
AnswerRe: Convert code C# 2008 to code C# 2005 ? Pin
Simon_Whale24-Feb-15 21:56
Simon_Whale24-Feb-15 21:56 
AnswerRe: Convert code C# 2008 to code C# 2005 ? Pin
OriginalGriff24-Feb-15 22:05
mveOriginalGriff24-Feb-15 22:05 
GeneralRe: Convert code C# 2008 to code C# 2005 ? Pin
Member 245846725-Feb-15 16:22
Member 245846725-Feb-15 16:22 
GeneralRe: Convert code C# 2008 to code C# 2005 ? Pin
OriginalGriff25-Feb-15 21:51
mveOriginalGriff25-Feb-15 21:51 
GeneralRe: Convert code C# 2008 to code C# 2005 ? Pin
Member 24584673-Mar-15 15:42
Member 24584673-Mar-15 15:42 
QuestionInsert the data of datagridview in a database. Pin
Ibrahim.elh24-Feb-15 20:45
Ibrahim.elh24-Feb-15 20:45 
QuestionRe: Insert the data of datagridview in a database. Pin
Eddy Vluggen25-Feb-15 0:31
professionalEddy Vluggen25-Feb-15 0:31 
AnswerRe: Insert the data of datagridview in a database. Pin
Ibrahim.elh25-Feb-15 1:55
Ibrahim.elh25-Feb-15 1:55 
I Have try this:

C#
con_local = new OdbcConnection();
                con_local.ConnectionString = lc.Connexion_locale;
                con_local.Open();
                for(int i=0; i< dataGridView1.Rows.Count-1;i++)
                {
                    
                    adap_local = new OdbcDataAdapter("insert into thisdet2 values(" + dataGridView1.Rows[i].Cells[1].Value + "," + dataGridView1.Rows[i].Cells[2].Value + "," + dataGridView1.Rows[i].Cells[3].Value + "," + dataGridView1.Rows[i].Cells[4].Value + "," + dataGridView1.Rows[i].Cells[5].Value + "," + dataGridView1.Rows[i].Cells[6].Value + "," + dataGridView1.Rows[i].Cells[7].Value + "," + dataGridView1.Rows[i].Cells[8].Value + "," + dataGridView1.Rows[i].Cells[9].Value + "," + dataGridView1.Rows[i].Cells[10].Value + "," + dataGridView1.Rows[i].Cells[11].Value + "," +  +")"+",", con_local);
                }
                ds_local = new System.Data.DataSet();
                adap_local.Fill(ds_local);

i have an error :

The exception was not handled System.ArgumentOutOfRangeException
HResult = -2146233086
Message = Index was out of range. It must not be negative and must be less than the size of the collection .
Parameter name: index
Source = mscorlib
ParamName index =
GeneralRe: Insert the data of datagridview in a database. Pin
Richard Deeming25-Feb-15 2:09
mveRichard Deeming25-Feb-15 2:09 
GeneralRe: Insert the data of datagridview in a database. Pin
Ibrahim.elh25-Feb-15 2:58
Ibrahim.elh25-Feb-15 2:58 
GeneralRe: Insert the data of datagridview in a database. Pin
Richard Deeming25-Feb-15 3:02
mveRichard Deeming25-Feb-15 3:02 
GeneralRe: Insert the data of datagridview in a database. Pin
Ibrahim.elh25-Feb-15 3:06
Ibrahim.elh25-Feb-15 3:06 
GeneralRe: Insert the data of datagridview in a database. Pin
Richard Deeming25-Feb-15 3:10
mveRichard Deeming25-Feb-15 3:10 
GeneralRe: Insert the data of datagridview in a database. Pin
Ibrahim.elh25-Feb-15 3:12
Ibrahim.elh25-Feb-15 3:12 
GeneralRe: Insert the data of datagridview in a database. Pin
Richard Deeming25-Feb-15 3:14
mveRichard Deeming25-Feb-15 3:14 
GeneralRe: Insert the data of datagridview in a database. Pin
Ibrahim.elh25-Feb-15 3:39
Ibrahim.elh25-Feb-15 3:39 
GeneralRe: Insert the data of datagridview in a database. Pin
Richard Deeming25-Feb-15 3:49
mveRichard Deeming25-Feb-15 3:49 
GeneralRe: Insert the data of datagridview in a database. Pin
Ibrahim.elh25-Feb-15 3:59
Ibrahim.elh25-Feb-15 3:59 
GeneralRe: Insert the data of datagridview in a database. Pin
Richard Deeming25-Feb-15 4:08
mveRichard Deeming25-Feb-15 4:08 
GeneralRe: Insert the data of datagridview in a database. Pin
Ibrahim.elh25-Feb-15 4:11
Ibrahim.elh25-Feb-15 4:11 
GeneralRe: Insert the data of datagridview in a database. Pin
Richard Deeming25-Feb-15 4:25
mveRichard Deeming25-Feb-15 4:25 
GeneralRe: Insert the data of datagridview in a database. Pin
Ibrahim.elh25-Feb-15 4:31
Ibrahim.elh25-Feb-15 4:31 
GeneralRe: Insert the data of datagridview in a database. Pin
Richard Deeming25-Feb-15 4:41
mveRichard Deeming25-Feb-15 4:41 
GeneralRe: Insert the data of datagridview in a database. Pin
Ibrahim.elh25-Feb-15 4:47
Ibrahim.elh25-Feb-15 4:47 
GeneralRe: Insert the data of datagridview in a database(error). Pin
Ibrahim.elh25-Feb-15 4:48
Ibrahim.elh25-Feb-15 4:48 

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.