Click here to Skip to main content
15,844,602 members
Home / Discussions / C#
   

C#

 
GeneralRe: How do I take datatable values into postgresql Pin
jschell3-Feb-23 6:23
jschell3-Feb-23 6:23 
GeneralRe: How do I take datatable values into postgresql Pin
Gerry Schmitz3-Feb-23 8:10
mveGerry Schmitz3-Feb-23 8:10 
AnswerRe: How do I take datatable values into postgresql Pin
Dave Kreskowiak2-Feb-23 10:11
mveDave Kreskowiak2-Feb-23 10:11 
AnswerRe: How do I take datatable values into postgresql Pin
Richard MacCutchan2-Feb-23 22:40
mveRichard MacCutchan2-Feb-23 22:40 
AnswerRe: How do I take datatable values into postgresql Pin
jschell3-Feb-23 6:30
jschell3-Feb-23 6:30 
GeneralRe: How do I take datatable values into postgresql Pin
Member 141039873-Feb-23 22:33
Member 141039873-Feb-23 22:33 
GeneralRe: How do I take datatable values into postgresql Pin
Dave Kreskowiak4-Feb-23 6:40
mveDave Kreskowiak4-Feb-23 6:40 
AnswerRe: How do I take datatable values into postgresql Pin
Richard Deeming5-Feb-23 23:52
mveRichard Deeming5-Feb-23 23:52 
Providing the details of the exception would have helped!
Member 14103987 wrote:
C#
DataTable table = new DataTable();
That creates a new empty DataTable, with no rows.
Member 14103987 wrote:
C#
adapter.FillSchema(table, SchemaType.Source);
That configures the columns of the table. There are still no rows in the table.
Member 14103987 wrote:
C#
DataRow row = table.NewRow();
That creates a new row with the same schema as the table. There are still no rows in the table.
Member 14103987 wrote:
C#
row.Table.Rows[0][0]
This attempts to retrieve the value of the first column of the first row of a table with no rows.

Unsurprisingly, this throws an IndexOutOfRangeException with the message "There is no row at position 0."

You cannot copy data that doesn't exist from an empty DataTable to itself. You need to work out precisely where the source data is stored, and copy from that instead.



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer

Question18 Errors Needs to be Fixed Pin
Michael Afolayan30-Jan-23 22:46
Michael Afolayan30-Jan-23 22:46 
AnswerRe: 18 Errors Needs to be Fixed Pin
Richard Deeming30-Jan-23 22:49
mveRichard Deeming30-Jan-23 22:49 
GeneralRe: 18 Errors Needs to be Fixed Pin
Michael Afolayan30-Jan-23 23:58
Michael Afolayan30-Jan-23 23:58 
GeneralRe: 18 Errors Needs to be Fixed Pin
Richard Deeming31-Jan-23 0:09
mveRichard Deeming31-Jan-23 0:09 
GeneralRe: 18 Errors Needs to be Fixed Pin
Richard MacCutchan31-Jan-23 0:11
mveRichard MacCutchan31-Jan-23 0:11 
GeneralRe: 18 Errors Needs to be Fixed Pin
Michael Afolayan31-Jan-23 0:23
Michael Afolayan31-Jan-23 0:23 
GeneralRe: 18 Errors Needs to be Fixed Pin
Richard MacCutchan31-Jan-23 0:09
mveRichard MacCutchan31-Jan-23 0:09 
GeneralRe: 18 Errors Needs to be Fixed Pin
Calin Negru1-Feb-23 2:00
Calin Negru1-Feb-23 2:00 
AnswerRe: 18 Errors Needs to be Fixed Pin
OriginalGriff30-Jan-23 23:09
mveOriginalGriff30-Jan-23 23:09 
GeneralRe: 18 Errors Needs to be Fixed Pin
Michael Afolayan31-Jan-23 0:15
Michael Afolayan31-Jan-23 0:15 
GeneralRe: 18 Errors Needs to be Fixed Pin
OriginalGriff31-Jan-23 3:06
mveOriginalGriff31-Jan-23 3:06 
GeneralRe: 18 Errors Needs to be Fixed Pin
CHill601-Feb-23 4:58
mveCHill601-Feb-23 4:58 
QuestionWhat's up with displaying transparent pixel? Closed Pin
mo149229-Jan-23 1:13
mo149229-Jan-23 1:13 
AnswerRe: What's up with displaying transparent pixel? Closed Pin
lmoelleb30-Jan-23 2:52
lmoelleb30-Jan-23 2:52 
QuestionWhy is my AlphaPanel approach to disable the entire GUI so slow? Pin
arnold_w25-Jan-23 5:45
arnold_w25-Jan-23 5:45 
AnswerRe: Why is my AlphaPanel approach to disable the entire GUI so slow? Pin
Gerry Schmitz25-Jan-23 7:09
mveGerry Schmitz25-Jan-23 7:09 
GeneralRe: Why is my AlphaPanel approach to disable the entire GUI so slow? Pin
arnold_w27-Jan-23 1:23
arnold_w27-Jan-23 1:23 

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.