views:

96

answers:

2

These are two records which exist in a table:

ibrahim_balouch
ibrahim.tasal

I want to send an email to ibrahim.tasal. Here is my code:

string user2 = dt1.Rows[1].ItemArray[0].ToString();
mail.Cc = dt1.Rows[1].ItemArray[0].ToString() + "@Roshan.af";

Is this correct?

A: 

EDIT: The subject, which was to the effect of 'Hi, look at this code', has been changed. Nevermind.

Justin
This is not helpful.
dtb
It wasn't helpful before the question was edited, either.
Rex M
Right. 'Hi, look at this code' was not a helpful subject title.
Justin
+1  A: 

If you need to get the particular column value of the first row of the datatable then something like this will help you

string user2 = dt.Rows[1].Columns["EmailColumn"].ToString();
mail.Cc = user2 + "@Roshan.af";

If you don't know the column name then you can specify the column index also which starts from 0.

rahul