|
|
 |
Quick Tips
A random sample of problems,
solutions presented as a set of simple step by step instructions
MS SQL Server Service Manager will not Start
P. After installing MS SQL Server the server is visible within the toolbar
notification area but has not started and attempts to start the application
lead to a login failure.
S. Problem - SQL automatic start account problem.
- Go to
Services in Control.Administrative tools.
- Select MSSQLSERVER, right click
Properties, select Log On type tab.
- Enter your password details OR select
Local System Account button.
Unable to Open a ASP.Net SQL Connection
P. Login failure occurs when running an ASP.Net program which opens a connection to a SQL database for the first time.
S. Problem - SQL server is not configured, by default, for user account access to a database, a table, or a view. Unless you permit access to the ASPNET user account, an ASP.NET application cannot read and cannot update data in an SQL Server database.
- Go to
Enterprise Manager in Start.All Programs.Microsoft SQL Server.
- Expand
Microsoft SQL Servers, expand SQL Server Group, expand (local) Server.
- Select
Security folder, right click Logins, select New Login.
- On
General tab, enter ASP.Net user name in Name textbox (yourservername/ASPNET).
- On
Database Access tab, check boxes for databases you require access to, ensure Public is ticked in Permit in Database Role listbox for each database. Select Ok button.
- On
Database folder, for each database select Users, right click the ASPNET user account, select properties.
- Click
Permissions… button, a new dialog box appears which shows the permissions for the ASPNET user account for all objects in the database. Scroll through the list selecting the check boxes that are associated with the tables and the views that the application requires access to.
- Click
Ok twice to close both dialog boxes, then close the Enterprise Manager.
SQL Query Analyzer executing SQL scripts
P. Many sample database base programs come with a SQL
script file (filename.sql) to create the tables and stored procedures requires
the use of the Query Analyzer program.
S. Problem – How to create the tables and stored procedures.
- Go to
Enterprise Manager in Start.All Programs.Microsoft SQL Server.
- Expand
Microsoft SQL Servers, expand SQL Server Group, expand (local)
Server.
- Select
Databases folder, right click, select New Databases…
- On
General tab enter name of your database in the Name: textbox then
select the Ok button.
- Your Database should now be listed, close the
Enterprise Manager.
- Go to
Query Analyzer in Start.All Programs.Microsoft SQL Server.
- Set up server,
SQL Server = (local), select Windows authentication
button.
- Enter your password details OR select
Local System Account button.
- Select your database using listbox on toolbar then open your script
file
file.open.
- Script is now displayed, execute script
F5, message should display ….successful..
message.
- Close
Query Analyzer you are now able to access your database.
Developing/Debugging Visual Studio .NET Add-ins
P. Visual Studio provides a wizard for creating Add-ins
but while developing and debugging updating can be unpredictable.
S. Problem – How to enable updates to add-in prior
to code finalisation.
- Open Visual Studio and on the
start page select New Project to create
the add-in.
- Select
Extensibility Projects under project type and then Visual Studio
.NET Add-in under templates.
- Enter a name for your add-in then select OK button whereupon the add-in
wizard dialog will be displayed.
- Step through the wizard recommended actions, beyond defaults deselect
VSMacros tick box and select tick box for ‘Tools’ menu item.
- After creating your add-in project open the
connect.cs file within
the solution explorer.
- While developing and before your run your add-in for the first time
- within the
connect.cs file comment out the if ConnectMode = … statement
within the OnConnection method, within the connect.cs file add the following
to the OnDisconnection method (C# code shown, remember to enter the
name of YourAddin on line 6):
// Dev/Debug code, get the commands collection. Commands commands = applicationObject.Commands ; try { // Delete the required command. Command command = commands.Item("YourAddin.Connect.YourAddin", -1); command.Delete(); } catch(System.Exception) { MessageBox.Show ("Add-in OnDisconnection failure"); }
As this code uses MessageBox add System.Windows.Forms to References in the Solution Explorer and as a Using statement within the connect.cs file, now build your code. When debugging, on the toolbar select Tools.Add-in Manager.. identify your add-in and tick the startup box, prior to closing Visual Studio reverse this action. You are now able to develop and debug your add-in remember to reverse the above code changes once you are ready to release your code.
 |
 |