need critics about coding technique

Dec 17 2010 8:38 AM

hey guys..i need some professional friends critics about the coding i made in my small project...when i want to select one row data from my project i coded like that..in my DataAccess layer
public
SqlDataAdapter FirmaDetails(string gelenFirma)
{
cmd =
new SqlCommand("sp_FirmaDetails", con);
cmd.CommandType =
CommandType.StoredProcedure;
cmd.Parameters.AddWithValue(
"@gelen_firma", System.Data.SqlDbType.NVarChar).Value = gelenFirma;
da =
new SqlDataAdapter(cmd);
return da;
}
and then in my Helper class
public
DataTable FirmaDetails(string gelenFirma)
{
da = d.FirmaDetails(gelenFirma);
da.Fill(dt);
return dt;
}
then to get the datas inside of my form
private void DetayForm_Load(object sender, EventArgs e)
{
dt =
new DataTable();
dt = helpr.FirmaDetails(textBox1.Text);
for (int i=0; i < dt.Rows.Count; i++)
{
lblYetkili.Text = dt.Rows[i][0].ToString();
lblGsm.Text = dt.Rows[i][1].ToString();
lblEmail.Text = dt.Rows[i][2].ToString();
lblYetkili2.Text = dt.Rows[i][3].ToString();
lblGsm2.Text = dt.Rows[i][4].ToString();
lblEmail2.Text = dt.Rows[i][5].ToString();
lblYetkili3.Text = dt.Rows[i][6].ToString();
lblGsm3.Text = dt.Rows[i][7].ToString();
lblEmail3.Text = dt.Rows[i][8].ToString();
}

}
now i wonder if it is too rookie technique(actually i am already) if it is how i can improve in better way..should i use SqlDataReader..thanks for your advices

Answers (2)