Datagrid Problem

S

scorpion53061

I have only built windows applications up to this point using vb.net. A
situation arose where I needed to do some web work so I decided to try
ASP.NET on my local machine.

Everything worked okay up until I put a datagrid on the page. I put in code
to make the datagrid populate on a button click event.

Every other control I wanted ot display did except the datagrid control. It
simply is invisible and does not display either before the button click or
after.

Can you tell me what I might have done wrong?

Dim sql2 As String
sql2 = "select CUST, [ITEM], [DESC], REL from results where (cust =
'8475')"
SqlDataAdapter1 = New SqlClient.SqlDataAdapter(sql2, SqlConnection1)
SqlDataAdapter1.Fill(DataSet11.Tables(0))
SqlConnection1.Close()
DataGrid1.DataSource = DataSet11.Tables(0)
DataGrid1.Visible = True
 
C

Cor Ligthert

Hi Scorpion,

Probably because strange enough as a difference with a windowforms control
it needs after the sentence

datagrid.datasource = x
datagrid.databind

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top