Tuesday, July 24, 2012

Common Mistakes

 The following are things that you might want to recheck if you're having problems.
  • Specifying the data source incorrectly. Depending on the database in question, the correct name, path, user ID, and password may need to be specified. The ADO.NET error message, though, is both polite and obvious - it will be something like Could not find file 'C:\BegASPNETdb\datastores\Southwind.mdb'.
  • Forgetting to specify namespaces, or doing so with the wrong syntax. This creates an error such as Type OleDbConnection not found.
  • Using the wrong object. Sometimes, people will try to use strConnection.Open() instead of objConnection.Open(). Once the connection object is created (objConnection), it is used in the rest of the page. The variable holding the connection string is only used to instantiate the connection object. This mistake produces errors such as The Open method is not a member of 'String'.
  • Trying to use unopened connection objects. Connection objects must be opened (not just instantiated) before they can be used. This mistake leads to clear error messages such as To use XXX object your Connection object must be Open.
  • Skipping the New keyword when declaring the connection object. This produces an error message such as Array bounds cannot appear in type specifiers.
  • Typing errors in the syntax of the connection string. You need to be careful here, as the syntax is different from normal Visual Basic syntax (spaces are allowed, arguments are separated by semicolons). This type of mistake tends to yield unhelpful error messages pointing to the Connection.Open() line, rather than the line where the connection object is declared. The most common ones are as follows:
    • Not putting a space in data source yields a message such as Could not find installable ISAM, pointing to the Connection.Open() line.
    • Using a comma instead of a semicolon to separate arguments yields an error message such as No error information available, pointing to the Connection.Open() line.
    • Forgetting a semicolon between arguments also yields an error message such as No error information available, pointing to the Connection.Open() line. This mistake might occur when you're concatenating or appending more than one argument across several lines of code.


If you are searching life partner. your searching end with kpmarriage.com. now kpmarriage.com offer free matrimonial website which offer free message, free chat, free view contact information. so register here : kpmarriage.com- Free matrimonial website