Retrieve Data from Database to Textbox using ADODB in C#

I am using ADODB Connection in C#.

Following is from VB code I want it like in C#.

    empcode.Text = IIf(IsDBNull(mRS("Accode").Value), "", mRS("Accode").Value)

Like above code, I want to retrieve data to a textbox in C#.

Thanks & Regards.

Upvotes: 0

Views: 73

Answers (1)

Mark PM
Mark PM

Reputation: 2919

You should really include more context to your question, but here goes:

empcode.Text = mRS.Fields["Accode"].Value == System.DBNull.Value ? string.Empty : mRS.Fields["Accode"].Value.ToString();

Upvotes: 1

Related Questions