Click here to Skip to main content
15,911,139 members
Home / Discussions / C#
   

C#

 
QuestionCheck if users on network Pin
20-Oct-05 0:14
suss20-Oct-05 0:14 
AnswerRe: Check if users on network Pin
Dave Kreskowiak20-Oct-05 3:22
mveDave Kreskowiak20-Oct-05 3:22 
GeneralRe: Check if users on network Pin
Mossie0120-Oct-05 19:50
professionalMossie0120-Oct-05 19:50 
GeneralRe: Check if users on network Pin
Dave Kreskowiak20-Oct-05 22:29
mveDave Kreskowiak20-Oct-05 22:29 
QuestionWindow Form repaint problem Pin
ppp00119-Oct-05 23:56
ppp00119-Oct-05 23:56 
Questionc# modem communication Pin
Anil Ch19-Oct-05 23:51
Anil Ch19-Oct-05 23:51 
AnswerRe: c# modem communication Pin
javad asadi17-Jan-12 18:35
javad asadi17-Jan-12 18:35 
QuestionDBNull.Value to string Pin
Brendan Vogt19-Oct-05 23:43
Brendan Vogt19-Oct-05 23:43 
Hi,

I have the following function that checks a database field for DBNull.Value. If it contains DBNull.Value, the it should return "", otherwise the string.

This is my calling function (objCustomer is an instance of the Customer class):

objCustomer.AddressLine1 = Globals.CheckStringForDBNulls(objDr["Address1"]);

This is my static function:

public static string CheckStringForDBNulls(string strCheckString)
{
if(strCheckString.Trim() == DBNull.Value)
return "";
else
return strCheckString.Trim();
}

Something tells me that my parameter string strCheckString is of the wrong type.

Please can someone help me correct this error/problem that I am having.

Regards.

-- modified at 5:45 Thursday 20th October, 2005
AnswerRe: DBNull.Value to string Pin
ZainAMJ20-Oct-05 0:11
ZainAMJ20-Oct-05 0:11 
GeneralRe: DBNull.Value to string Pin
Brendan Vogt20-Oct-05 0:40
Brendan Vogt20-Oct-05 0:40 
GeneralRe: DBNull.Value to string Pin
ZainAMJ20-Oct-05 0:48
ZainAMJ20-Oct-05 0:48 
GeneralRe: DBNull.Value to string Pin
Brendan Vogt20-Oct-05 1:06
Brendan Vogt20-Oct-05 1:06 
GeneralRe: DBNull.Value to string Pin
ZainAMJ20-Oct-05 17:07
ZainAMJ20-Oct-05 17:07 
GeneralRe: DBNull.Value to string (Error In That Code) Pin
ZainAMJ20-Oct-05 17:10
ZainAMJ20-Oct-05 17:10 
AnswerRe: DBNull.Value to string Pin
Guffa20-Oct-05 1:31
Guffa20-Oct-05 1:31 
QuestionString conversion to DBNull.Value Pin
Brendan Vogt19-Oct-05 23:35
Brendan Vogt19-Oct-05 23:35 
AnswerRe: String conversion to DBNull.Value Pin
Dead Skin Mask20-Oct-05 0:13
Dead Skin Mask20-Oct-05 0:13 
GeneralRe: String conversion to DBNull.Value Pin
Brendan Vogt20-Oct-05 0:40
Brendan Vogt20-Oct-05 0:40 
GeneralRe: String conversion to DBNull.Value Pin
Dead Skin Mask20-Oct-05 1:28
Dead Skin Mask20-Oct-05 1:28 
GeneralRe: String conversion to DBNull.Value Pin
Brendan Vogt20-Oct-05 2:16
Brendan Vogt20-Oct-05 2:16 
QuestionAudioVideoPlayback: Video as texture. Unable to Dispose() Pin
Pixinger7719-Oct-05 23:15
Pixinger7719-Oct-05 23:15 
QuestionXML File encryption Pin
rmedo19-Oct-05 22:49
rmedo19-Oct-05 22:49 
AnswerRe: XML File encryption Pin
Guffa19-Oct-05 23:35
Guffa19-Oct-05 23:35 
GeneralRe: XML File encryption Pin
rmedo23-Oct-05 2:03
rmedo23-Oct-05 2:03 
GeneralRe: XML File encryption Pin
Guffa24-Oct-05 21:24
Guffa24-Oct-05 21:24 

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.