Scotts right, even though you use a connection in one place and it works
fine there, that doesn't mean it will work right in all situations. I've
seen people accidentally use connections they have for a sql connection then
try to pass that to an oledb connection so that's why it's important. We've
also helped people that had connection string problems simply because they
used the wrong connection string name or spelling in their code and they
swore up and down that the connection string and the call to get it were
correct. Technically they were right, just misspelled their connection
string and it happens to the best of us which is why we ask.
Does the page run without any errors at all? Have you checked to see that
data is being returned? One think I often do with a dataset is use the
Trace.Write() method to output information about the dataset to the trace
file. Things like how many tables, the names of the tables and the number of
rows of each. If you can get this far then you can definitely see that data
is getting passed and know for sure that data retrieval works. When
something like this isn't working, the first thing I always try is dump some
message using Trace.Write just as soon as the event starts so I'm sure the
event is actually firing. Sometimes the event doesn't fire and it's easy to
end up running down a rathole looking for the wrong error.
--
Hope this helps,
Mark Fitzpatrick
Microsoft MVP - Expression
[quoted text, click to view] "Paul W Smith" <pws@NOSPAM.twelve.me.uk> wrote in message
news:utp5X%232CIHA.1208@TK2MSFTNGP05.phx.gbl...
> Protected Sub Page_Load(ByVal sender As Object, ByVal e As
> System.EventArgs)
>
>
> Dim sSQL As String = "SELECT * FROM tPlayers"
>
> Dim myAdapter As OleDbDataAdapter = New
> OleDbDataAdapter(sSQL,myConnection)
>
>
> Dim MyDataSet As New DataSet
>
> myAdapter.Fill(MyDataSet)
>
>
> GridView1.DataSource = MyDataSet
>
> GridView1.DataBind()
>
> myConnection.Close()
>
> End Sub
>
>
>
> I know the connection string is good because I use it else where, I have
> edited out from the event above.
>
> I have the require Namespaces , so it must be syntax, but I cannot for the
> life of me see what the problem is.
>
> Can anyone else?
>
>
>