Click here to Skip to main content
15,921,716 members

Comments by ameer.ahmd (Top 4 by date)

ameer.ahmd 20-Mar-13 12:05pm View    
the problem is that i didnt use order by idnum in my select ....
ameer.ahmd 15-Mar-13 23:57pm View    
to be more explicit there are 585 record in the table and access indicate the record 610 as
560 from 585 and the record count during runtime reach to 585 (i put it in a new textbox)
the question is why the application display the 560 as the last record while it reach
the last 585?????
ameer.ahmd 15-Mar-13 15:11pm View    
yes there are many deleted records but the code (as i understand)take the existing records from the table and put it in dataset3 and go to the last record ,also it was work correctly for tow months
when i open the db by access i found about 29 records after 610 so i deleted the record 610
the result was that the application considered the 609 as the last record?????
is there any relation between the autonumber and the Count?
ameer.ahmd 15-Mar-13 13:18pm View    
thanks for replay this is the function i use to display the last record ,its archive application
so i need to know the last record that i entered yesterday
after i save the record i use this to take its id so i can use it as a name for the page i get by
the scanner

static string str = "provider=microsoft.jet.oledb.4.0;data source=" + Application.StartupPath + "\\scti.mdb";
OleDbConnection con = new OleDbConnection(str);
OleDbDataAdapter dataadapter3;
DataSet dataset3 = new DataSet();
<pre lang="cs">private void get_idtext()
{
textBox8.DataBindings.Clear();
string sid = "select idnum from received";
dataadapter3 = new OleDbDataAdapter(sid, con);
try
{
con.Open();
dataadapter3.Fill(dataset3, "received");
con.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
this.BindingContext[dataset3, "received"].Position = this.BindingContext[dataset3, "received"].Count - 1;
textBox8.DataBindings.Add("text", dataset3, "received.idnum");
}</pre>