Click here to Skip to main content
15,913,836 members
Home / Discussions / C#
   

C#

 
AnswerRe: pleas help me urgently in the problem of reports using in visual studio Pin
Christian Graus1-Jun-09 20:35
protectorChristian Graus1-Jun-09 20:35 
GeneralRe: pleas help me urgently in the problem of reports using in visual studio Pin
seeramzanse1-Jun-09 20:39
seeramzanse1-Jun-09 20:39 
GeneralRe: pleas help me urgently in the problem of reports using in visual studio Pin
Rajesh R Subramanian1-Jun-09 21:35
professionalRajesh R Subramanian1-Jun-09 21:35 
AnswerRe: pleas help me urgently in the problem of reports using in visual studio Pin
Colin Angus Mackay1-Jun-09 20:54
Colin Angus Mackay1-Jun-09 20:54 
QuestionHow to implement IDocHostUIHandler Interface in c#? Pin
svt gdwl1-Jun-09 19:53
svt gdwl1-Jun-09 19:53 
QuestionMDI Application. Pin
vinay_K1-Jun-09 19:45
vinay_K1-Jun-09 19:45 
QuestionError: Unable to cast object of type 'System.DateTime' to type 'System.String'. Pin
KIDYA1-Jun-09 18:41
KIDYA1-Jun-09 18:41 
AnswerRe: Error: Unable to cast object of type 'System.DateTime' to type 'System.String'. Pin
Mbah Dhaim1-Jun-09 18:58
Mbah Dhaim1-Jun-09 18:58 
I also had experienced this, so i change the Get[Type]() methods such as GetString(index), GetInt16(index) etc with GetValue(i) or DataReader indexer it self, but it must be checked first if return value is DBNull.
In your case replace your code in line that gives error with
KIDYA wrote:
strRow += (string)dr.GetString(i); // Gives error here


if (!Convert.IsDBNull(dr[i]){
   strRow +=dr[i].ToString();
}

or 

if (!Convert.IsDBNull(dr.GetValue(i)){
   strRow +=dr.GetValue(i).ToString();
}


hope it helps

dhaim
ing ngarso sung tulodho, ing madyo mangun karso, tut wuri handayani. "Ki Hajar Dewantoro"
in the front line gave a lead, in the middle line build goodwill, in the behind give power support



GeneralRe: Error: Unable to cast object of type 'System.DateTime' to type 'System.String'. Pin
KIDYA1-Jun-09 20:20
KIDYA1-Jun-09 20:20 
AnswerRe: Error: Unable to cast object of type 'System.DateTime' to type 'System.String'. Pin
Christian Graus1-Jun-09 19:34
protectorChristian Graus1-Jun-09 19:34 
QuestionImage objects to PDF files Pin
Member 46783511-Jun-09 17:09
Member 46783511-Jun-09 17:09 
AnswerRe: Image objects to PDF files Pin
Christian Graus1-Jun-09 19:38
protectorChristian Graus1-Jun-09 19:38 
QuestionVista file virtualization: Deleting files when uninstalling program Pin
choo_chu1-Jun-09 16:51
choo_chu1-Jun-09 16:51 
QuestionCode for Restart Console Application Pin
Serpendiem1-Jun-09 16:37
Serpendiem1-Jun-09 16:37 
GeneralRe: Code for Restart Console Application Pin
Calla1-Jun-09 19:37
Calla1-Jun-09 19:37 
QuestionHow to store a large number of XML to the MSSQL200 database in a field Pin
cady_4001-Jun-09 15:15
cady_4001-Jun-09 15:15 
AnswerRe: How to store a large number of XML to the MSSQL200 database in a field Pin
Christian Graus1-Jun-09 19:38
protectorChristian Graus1-Jun-09 19:38 
Questionis it bug of the microsoft?(about multilanguage) [modified] Pin
yuwenxiang1-Jun-09 14:59
yuwenxiang1-Jun-09 14:59 
QuestionC# TCP Close Socket Question Pin
Serpendiem1-Jun-09 13:43
Serpendiem1-Jun-09 13:43 
AnswerRe: C# TCP Close Socket Question Pin
Luc Pattyn1-Jun-09 14:41
sitebuilderLuc Pattyn1-Jun-09 14:41 
Question[Message Deleted] Pin
Star091-Jun-09 13:08
Star091-Jun-09 13:08 
AnswerRe: Can't Add a Row ( Access DB) Pin
Christian Graus1-Jun-09 13:10
protectorChristian Graus1-Jun-09 13:10 
AnswerRe: [Message Deleted] Pin
Colin Angus Mackay1-Jun-09 13:21
Colin Angus Mackay1-Jun-09 13:21 
QuestionC# TCP Cycle Pin
Serpendiem1-Jun-09 12:42
Serpendiem1-Jun-09 12:42 
AnswerRe: C# TCP Cycle Pin
Jimmanuel1-Jun-09 14:42
Jimmanuel1-Jun-09 14:42 

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.