Dim objConn As System.Data.OleDb.OleDbConnection
Dim objCmd As System.Data.OleDb.OleDbCommand
Dim strConnString As String
strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath("database/mydatabase.mdb")&";Jet OLEDB:Database Password=;"
objConn = New System.Data.OleDb.OleDbConnection(strConnString)
objConn.Open()
Dim strSQL As String
strSQL = "SELECT * FROM customer"
Dim dtReader As System.Data.OleDb.OleDbDataReader
objCmd = New System.Data.OleDb.OleDbCommand(strSQL, objConn)
dtReader = objCmd.ExecuteReader()
protected void Button1_Click(object sender, EventArgs e)
{
string connectionString = ConfigurationManager.ConnectionStrings["Conn"].ConnectionString;
using (SqlConnection conn = new SqlConnection(connectionString))
{
string sqlString;
sqlString = "SELECT * FROM Userdata";
DA SqlDataAdapter;
DS DataSet;
DA = New SqlDataAdapter(sqlString, conn);
DA.Fill(DS, "DSUserdata");
string strConn;
string Sqlselect;
strConn = WebConfigurationManager.ConnectionStrings["Conn"].ConnectionString;
SqlConnection connect = new SqlConnection(strConn);
connect.Open();
Sqlselect = "select * from Userdata";
SqlDataAdapter da = new SqlDataAdapter(Sqlselect, connect);
DataSet ds = new DataSet();
da.Fill(ds,"Userdata");
connect.Close();
int countrows = ds.Tables["Userdata"].Rows.Count;
int countcolums = ds.Tables["Userdata"].Columns.Count;
for (int x = 0; x < countrows; x++)
{
for (int y = 1; y < countcolums; y++)
{
Response.Write(ds.Tables["Userdata"].Rows[x][y].ToString() + "<br>" );
}
Response.Write("<hr>");
}