You're opening connection after Filling the dataset: You should always open
connection first (i amended the code a little bit):
private void BindDataGrid()
{
SqlDataAdapter myAdapter=new SqlDataAdapter("SELECT * from Billing", con);
DataSet ds = new DataSet();
try
{
con.Open():
myAdapter.Fill(ds);
}
catch
{
throw;
}
finally
{
con.Close();
}
dgbilling.DataSource = ds;
dgbilling.DataBind();
}
Hope it helps
Milosz
"rcoco" wrote:
Quote:
On Feb 20, 2:17 pm, Milosz Skalecki [MCAD] <mily...@DONTLIKESPAMwp.pl>
wrote:
Quote:
Hi Rococo,
Paste some code so we could investigate.
--
Milosz
"rcoco" wrote:
Quote:
hi,
I'm having problem with seeing my datagrid? Yet I set Property visible
to true and I'm caling the DataBind() what could be the Problem. I
mayed be forgetting something.. Could you please help?
Thanks?- Hide quoted text -
- Show quoted text -
>
hi miloz,
here is the code I'm using.
>
private void Page_Load(object sender, System.EventArgs e)
{
if (! IsPostBack)
{
BindDataGrid();
>
}
}
>
private void BindDataGrid()
{
>
SqlDataAdapter myAdapter=new SqlDataAdapter("SELECT * from
Billing",con);
DataSet ds=new DataSet();
myAdapter.Fill(ds);
con.Open();
>
dgbilling.DataSource=ds;
dgbilling.DataBind();
con.Close();
}
>
Thanks.
>
>