# Asp.net database connection

**URL:** <https://forum.kirupa.com/t/asp-net-database-connection/207892>\
**Category:** Uncategorized\
**Created:** [November 22, 2006, 2:35pm UTC](https://forum.kirupa.com/t/asp-net-database-connection/207892 "2006-11-22T14:35:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gaurabmani](https://avatars.discourse-cdn.com/v4/letter/g/aeb1de/32.png) [@gaurabmani](https://forum.kirupa.com/u/gaurabmani)\
**Post date:** [November 22, 2006, 2:35pm UTC](https://forum.kirupa.com/t/asp-net-database-connection/207892/1 "2006-11-22T14:35:50Z")

</div>

I have problen connecting to the access database through [asp.net](http://asp.net),  
this is the page load code  
private void Page\_Load(object sender, System.EventArgs e)  
{

```
oleDbConnection1.Open();
oleDbDataAdapter1.SelectCommand.CommandText="select country from players";
dataReader=oleDbDataAdapter1.SelectCommand.ExecuteReader();
while(dataReader.Read())
{
 nameList.Items.Add(dataReader.GetString(0));
 oleDbConnection1.Close();
}

```

}  
i got an error  
c:\inetpub\wwwroot\dropdown\_database\WebForm1.aspx.cs(32): The name ‘dataReader’ does not exist in the class or namespace ‘dropdown\_database.WebForm1’  
c:\inetpub\wwwroot\dropdown\_database\WebForm1.aspx.cs(33): The type or namespace name ‘dataReader’ could not be found (are you missing a using directive or an assembly reference?)  
what it means and how i can overcome this problem ??
