Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 display to textbox c# problem

views
     
TSmike9407
post Sep 21 2016, 07:08 PM, updated 8y ago

On my way
****
Junior Member
604 posts

Joined: May 2015
CODE
public void display(event_detail e)
       {
           string path = Directory.GetCurrentDirectory();
           string connstring = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + path + @"\GameMuseumManagementSystem.mdb";
           OleDbConnection conn = new OleDbConnection(connstring); //Create connection
           conn.Open();

           OleDbCommand cmd = new OleDbCommand("SELECT * from Event  WHERE Event_Title ='" +PassName  + "'", conn); //Create command

           cmd.Connection = conn; //command connect to database

           OleDbDataReader myReader = cmd.ExecuteReader();
           while (myReader.Read())
           {
               e.notxt.Text = (myReader["Event_No"].ToString());
               //e.notxt.ReadOnly = true;
               e.titletxt.Text = (myReader["Event_Name"].ToString());
               //e.titletxt.ReadOnly = true;
               e.datedetail.Text = (myReader["Event_Date"].ToString());
               //e.datedetail.ReadOnly = true;
               e.detailtxt.Text = (myReader["Event_detail"].ToString());
               //e.detailtxt.ReadOnly = true;
             
           }
       }

this is my code,i has put this function in my case there,why i still cant retrive data from my access database ,is it the database problem??or ?because my access is version 2013 which is pirated version
narf03
post Sep 21 2016, 10:47 PM

Look at all my stars!!
*******
Senior Member
4,545 posts

Joined: Dec 2004
From: Metro Prima, Kuala Lumpur, Malaysia, Earth, Sol


can u tell us the error message ?


 

Change to:
| Lo-Fi Version
0.0158sec    0.59    5 queries    GZIP Disabled
Time is now: 29th March 2024 - 05:18 PM