Click here to Skip to main content
15,867,308 members
Home / Discussions / C#
   

C#

 
GeneralRe: How do I take datatable values into postgresql Pin
jschell3-Feb-23 5:23
jschell3-Feb-23 5:23 
GeneralRe: How do I take datatable values into postgresql Pin
Gerry Schmitz3-Feb-23 7:10
mveGerry Schmitz3-Feb-23 7:10 
AnswerRe: How do I take datatable values into postgresql Pin
Dave Kreskowiak2-Feb-23 9:11
mveDave Kreskowiak2-Feb-23 9:11 
AnswerRe: How do I take datatable values into postgresql Pin
Richard MacCutchan2-Feb-23 21:40
mveRichard MacCutchan2-Feb-23 21:40 
AnswerRe: How do I take datatable values into postgresql Pin
jschell3-Feb-23 5:30
jschell3-Feb-23 5:30 
GeneralRe: How do I take datatable values into postgresql Pin
Member 141039873-Feb-23 21:33
Member 141039873-Feb-23 21:33 
GeneralRe: How do I take datatable values into postgresql Pin
Dave Kreskowiak4-Feb-23 5:40
mveDave Kreskowiak4-Feb-23 5:40 
AnswerRe: How do I take datatable values into postgresql Pin
Richard Deeming5-Feb-23 22:52
mveRichard Deeming5-Feb-23 22: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 21:46
Michael Afolayan30-Jan-23 21:46 
AnswerRe: 18 Errors Needs to be Fixed Pin
Richard Deeming30-Jan-23 21:49
mveRichard Deeming30-Jan-23 21:49 
GeneralRe: 18 Errors Needs to be Fixed Pin
Michael Afolayan30-Jan-23 22:58
Michael Afolayan30-Jan-23 22:58 
GeneralRe: 18 Errors Needs to be Fixed Pin
Richard Deeming30-Jan-23 23:09
mveRichard Deeming30-Jan-23 23:09 
GeneralRe: 18 Errors Needs to be Fixed Pin
Richard MacCutchan30-Jan-23 23:11
mveRichard MacCutchan30-Jan-23 23:11 
GeneralRe: 18 Errors Needs to be Fixed Pin
Michael Afolayan30-Jan-23 23:23
Michael Afolayan30-Jan-23 23:23 
GeneralRe: 18 Errors Needs to be Fixed Pin
Richard MacCutchan30-Jan-23 23:09
mveRichard MacCutchan30-Jan-23 23:09 
GeneralRe: 18 Errors Needs to be Fixed Pin
Calin Negru1-Feb-23 1:00
Calin Negru1-Feb-23 1:00 
AnswerRe: 18 Errors Needs to be Fixed Pin
OriginalGriff30-Jan-23 22:09
mveOriginalGriff30-Jan-23 22:09 
GeneralRe: 18 Errors Needs to be Fixed Pin
Michael Afolayan30-Jan-23 23:15
Michael Afolayan30-Jan-23 23:15 
GeneralRe: 18 Errors Needs to be Fixed Pin
OriginalGriff31-Jan-23 2:06
mveOriginalGriff31-Jan-23 2:06 
GeneralRe: 18 Errors Needs to be Fixed Pin
CHill601-Feb-23 3:58
mveCHill601-Feb-23 3:58 
QuestionWhat's up with displaying transparent pixel? Closed Pin
mo149229-Jan-23 0:13
mo149229-Jan-23 0:13 
AnswerRe: What's up with displaying transparent pixel? Closed Pin
lmoelleb30-Jan-23 1:52
lmoelleb30-Jan-23 1:52 
QuestionWhy is my AlphaPanel approach to disable the entire GUI so slow? Pin
arnold_w25-Jan-23 4:45
arnold_w25-Jan-23 4:45 
AnswerRe: Why is my AlphaPanel approach to disable the entire GUI so slow? Pin
Gerry Schmitz25-Jan-23 6:09
mveGerry Schmitz25-Jan-23 6:09 
GeneralRe: Why is my AlphaPanel approach to disable the entire GUI so slow? Pin
arnold_w27-Jan-23 0:23
arnold_w27-Jan-23 0: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.