Problem with connect to MS Access...

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: May 2009
Posts: 29
Reputation: Krstevski is an unknown quantity at this point 
Solved Threads: 0
Krstevski's Avatar
Krstevski Krstevski is offline Offline
Light Poster

Problem with connect to MS Access...

 
0
  #1
Jul 5th, 2009
Hey people, I have a problem with connect to MS Access database...

I use C#.NET and MS Access 2002-2003

Here is my code:
  1. ...
  2. using System.Data.OleDb;
  3.  
  4. namespace Потсетник
  5. {
  6. public partial class Form1 : Form
  7. {
  8. public OleDbConnection database;
  9.  
  10. public Form1()
  11. {
  12. InitializeComponent();
  13.  
  14. string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=zapis.mdb";
  15. try
  16. {
  17.  
  18. database = new OleDbConnection(connectionString);
  19. database.Open();
  20.  
  21. string queryString = "SELECT ID, Име, Презиме, Ник, Мобилен, Мобилен2, e-Mail, e-Mail2, Type FROM Table1 WHERE Table1.ID = Table1.ID";
  22. loadDataGrid(queryString);
  23. }
  24. catch (Exception ex)
  25. {
  26. MessageBox.Show(ex.Message);
  27. return;
  28. }
  29. }
  30. ...

And now, when I start the application I get message „No value given for one or more required parameters“.

Where I wrong ?
Thanks...
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 2,065
Reputation: Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice 
Solved Threads: 256
Featured Poster
Ramy Mahrous's Avatar
Ramy Mahrous Ramy Mahrous is offline Offline
Postaholic

Re: Problem with connect to MS Access...

 
0
  #2
Jul 5th, 2009
Is this statement "SELECT ID, Име, Презиме, Ник, Мобилен, Мобилен2, e-Mail, e-Mail2, Type FROM Table1 WHERE Table1.ID = Table1.ID" valid?
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
Reply With Quote Quick reply to this message  
Join Date: May 2009
Posts: 29
Reputation: Krstevski is an unknown quantity at this point 
Solved Threads: 0
Krstevski's Avatar
Krstevski Krstevski is offline Offline
Light Poster

Re: Problem with connect to MS Access...

 
0
  #3
Jul 5th, 2009
Originally Posted by Ramy Mahrous View Post
Is this statement "SELECT ID, Име, Презиме, Ник, Мобилен, Мобилен2, e-Mail, e-Mail2, Type FROM Table1 WHERE Table1.ID = Table1.ID" valid?
If you mean for unicode/encode... this is not problem, I'm sure for that.
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 2
Reputation: Archduke is an unknown quantity at this point 
Solved Threads: 0
Archduke's Avatar
Archduke Archduke is offline Offline
Newbie Poster

Re: Problem with connect to MS Access...

 
0
  #4
Jul 5th, 2009
I had some problems with using cyrilic letters with SQL a while back, try reverting to latin? Just for test
roses are #FF0000, violets are #0000FF
all my base are belong to you
Reply With Quote Quick reply to this message  
Join Date: May 2009
Posts: 29
Reputation: Krstevski is an unknown quantity at this point 
Solved Threads: 0
Krstevski's Avatar
Krstevski Krstevski is offline Offline
Light Poster

Re: Problem with connect to MS Access...

 
0
  #5
Jul 5th, 2009
Originally Posted by Archduke View Post
I had some problems with using cyrilic letters with SQL a while back, try reverting to latin? Just for test
I did not have a problem with the cyrillic when i made my first program Home DVD (if you understand macedoninan ).

Here is the code for my first program:
  1. string queryString = "SELECT movieID, Наслов, Издавач, Гледан, Година, Type FROM movie,movieType WHERE movietype.typeID = movie.typeID";
Last edited by Krstevski; Jul 5th, 2009 at 10:29 am.
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 2,065
Reputation: Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice 
Solved Threads: 256
Featured Poster
Ramy Mahrous's Avatar
Ramy Mahrous Ramy Mahrous is offline Offline
Postaholic

Re: Problem with connect to MS Access...

 
0
  #6
Jul 5th, 2009
  1. string queryString = "SELECT movieID, Наслов, Издавач, Гледан, Година, Type FROM movie,movieType WHERE movietype.typeID = movie.typeID";
  2. //Sure you mean
  3. string queryString = "SELECT movieID, Наслов, Издавач, Гледан, Година, Type FROM movie,movieType WHERE movietype.typeID =" movie.typeID;
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC