1
Answer

call method to retrieve in presantation

Ask a question
Nompilo Ntui

Nompilo Ntui

16y
2.7k
1

i 'm coding in 3 tier i did datalayer and business logic my problem is with presantation i try this code to cal my business logic and to popolate my text box but it gives me problem.it gives me this error Error 2 Cannot convert method group 'ToString' to non-delegate type 'string'.

here is my code:

string OffN = txtName.Text.ToString();

HBLL= new BusinessLogic.HeadOffice();

DataSet ds = HBLL.selectHead(str);

DataTable t1 = ds.Tables["Head_Office"];

DataRow row;

row = ds.Tables[0].Rows[0];

foreach (DataRow Rows in ds.Tables[0].Rows)

{

//txtName.Text = t1.Rows["OfficeName"].ToString;

txtName.Text = t1.Rows[0]["OfficeName"].ToString;

ddlCity.Text = t1.Rows[1]["CityName"].ToString;

ddlLocation.Text = t1.Rows[2]["LocationName"].ToString;

txtAdd.Text = t1.Rows[3]["Address"].ToString;

txtTelephone.Text = t1.Rows[4]["TelephoneNo"].ToString;

txtEmail.Text = t1.Rows[5]["E_mail"].ToString;

}

}

catch (Exception ex)


 


Answers (1)