Link to home
Start Free TrialLog in
Avatar of tenriquez199
tenriquez199

asked on

how retrieve data acccess db with c#

hi..

i'm making a web application in c# read access db this is my code:

        protected void Consultar_Click1(object sender, EventArgs e)
        {
            string sql = @"SELECT Id_Venta
                                  ,Id_Producto
                                  ,Cantidad
                                  ,Fecha_Venta
                                  ,Id_Cajero
                              FROM VENTAS
                              WHERE Id_Venta = @Id";

            string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\TOÑO\\daniel\\Database21.mdb";
            System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection(connectionString);
            System.Data.OleDb.OleDbDataAdapter myDataAdapter = new System.Data.OleDb.OleDbDataAdapter("SELECT * FROM VENTAS where ID_Venta = '" + "1" + "'", conn);
            System.Data.DataSet myDataSet = new System.Data.DataSet("VENTAS");
            myDataAdapter.Fill(myDataSet, "VENTAS");
           
            conn.Close();
           
            return ;





            }


someone can help me...i need to put data retrieved at textboxes, but i don't know wich stape missing

thanks a lot
ASKER CERTIFIED SOLUTION
Avatar of gery128
gery128
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tenriquez199
tenriquez199

ASKER

thanks