BEFORE generating your code, set your RUN-TIME connection properties:
The connection you used to import your schema is DIFFERENT than the connection
your application needs at run time. The easiest way to get this right is use
TCDesigner. In the Project Explorer, click on Data Objects. Now set the
database connection properties that your application will need when it runs. If
you've already generated your code, the settings you need to fix are in the
Constructor of BaseDASettings.vb. Set GrantUserExecute to True if you want this
user to have execute permissions on the stored procedures. You cannot GRANT
EXECUTE to a userid that is the OWNER of the database.
INSTALL your generated stored procedures in the RUN-TIME database:
Again, the easiest way to do this is from TCDesigner. From the Tools menu,
choose Run Procedures. Then just use the provided dialog to connect to the
target database and install all the generated stored procedures quickly. The
proper execute permissions SHOULD be set. However, this assumes that you have
the AUTHORITY to GRANT EXECUTE, and you may not!
For VB.NET projects, BLANK OUT the Root namespace property of your Visual
Studio project:
After you have created the Visual Studio project but BEFORE you have added the
TCDesigner-generated classes, remove any value in the Root Namespace property
of your project. Here's how: In the Solution Explorer, right mouse click
on your project (not the solution) and select Properties. The dialog
should come up showing Common Properties, General. If there is a value in
Root namespace, remove it completely and click OK.
Now you can add your TCDesigner-generated code to your Visual Studio
project.
Worst-case scenario: Step-by-step debugging instructions for VB.NET
projects!
1. Set breakpoints in these files on these line numbers: BaseDAConn.vb line 69
and BaseDACommon.vb line 902
2. Make sure WebMainMenu.aspx is "Set as Start Page" and start a Debug session.
3. Click on any button on the Main Menu page.
4. The debugger will stop at the first breakpoint. in BaseDAConn.vb: examine
the value of strConnectionString it should look something like this:
"Initial Catalog=Northwind;Data Source=
YOURSQLSERVER;UserID=YOURID;Password=YOURPASS;Connect Timeout=60"
Once you've exited BaseDAConn, it's "IsOpen" property should be True.
5. Hit Continue to move on to the next breakpoint.
in BaseDACommon.vb: line 902:
objDBData.DataReader = objDBCommand.ExecuteReader()
This is where the stored procedure is run and the datareader filled. If there
is anything wrong, with either the connection, or the stored procedure, an
exception will be thrown. if that happens, step into the Catch block and
examine the "err" variable
If you end up with an exception here, most likely you did not correctly install
the generated stored procedures OR there is not proper execute permissions set
on them. Either way "err" will tell you exactly what the trouble is.