עבור לתוכן
View in the app

A better way to browse. Learn more.

HWzone

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

בעיית חיבור בין סי שארפ לבייס (האקסס של אופן אופיס)

Featured Replies

פורסם

התקנתי על המחשב אופן אופיס וכעת אני מתקשה ליצור קוד שמוסיף לטבלה שורה

 

תודה רבה

 


     private void btnGo_Click(object sender, EventArgs e)
        {
            
            string ConnStr = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Users\\Public\\pro\\db.odb";

            OleDbConnection MyConn = new OleDbConnection(ConnStr);

            try
            {

                MyConn.Open();

                string mySelectQuery = "INSERT INTO tblNames (ID, strName) ";
                mySelectQuery = mySelectQuery + " VALUES (@ID, @strName) ";
                
                OleDbCommand insert_command = new OleDbCommand(mySelectQuery);
                
                insert_command.Parameters.AddWithValue("@strName", "20160229");
                insert_command.Parameters.AddWithValue("@ID", 10);
                
                insert_command.ExecuteNonQuery();

            }
            catch (Exception exc)
            {
                System.Windows.Forms.MessageBox.Show(exc.ToString());
                try
                {
                    using (StreamWriter writer = new StreamWriter("C:\\Users\\Public\\pro\\bug.txt"))
                    {
                        writer.Write(exc.ToString());
                        writer.WriteLine(" ");
                        
                    }
                }//try

                catch (Exception ex)
                {
                    System.Windows.Forms.MessageBox.Show(ex.ToString());

                }
            }
            finally
            {
                MyConn.Close();
            }
        }

System.Data.OleDb.OleDbException (0x80004005): Unrecognized database format 'C:\Users\Public\pro\db.odb'.
   at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection)
   at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
   at System.Data.ProviderBase.DbConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
   at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions)
   at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at System.Data.ProviderBase.DbConnectionInternal.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
   at System.Data.OleDb.OleDbConnection.Open()
   at try2.Form1.btnGo_Click(Object sender, EventArgs e) in 


 

פורסם

לא מכיר את בייס באופן ספציפי אבל בשיטת החיבור שאתה מנסה אתה צריך להתקין OleDB Driver עבור בייס.

 

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.