# VBForums CodeBank > CodeBank - ASP / ASP.NET / MVC / Web API >  ASP.NET Tutorial

## Memnoch1207

I have created an ASP.NET tutorial. This tutorial is was designed in VS.NET 2003 using a SQL Server 2000 backend.

The tutorial contains the following.
1) A simple DML (Data Manipulation Layer) class containing common database functionality.

2) Examples of the following...
   a) Datagrid Paging
   b) Displaying images in a datagrid
   c) Inserting/Updating/Deleting database records through stored procedure calls.

I have scripted out the database, so you can run the sql script in query analyzer and create all of the required database objects (tables, stored procedures, etc...).

I have also included a states.xls spreadsheet that can be imported into the "States" table (using DTS) once the database and all objects have been created.

If you have any questions let me know.

----------


## TSAR

Seems intresting, but I cann't do anything except surfing (add/edit doesn't work even if I don't receive any message) :-(

Any idea ?

----------


## Memnoch1207

What are you talking about?

----------


## TSAR

Hmm, will give you an example.

When I start the application i receive the main screen, where i push "Departments".  I receive a new screen whith one department (name 1).  I try to add one, so i push "Add New Department".  He asks me a name, i give in "2" and push on submit.

I receive the earlier screen of the departments, but only the "1" is on the screen.  Same problem for positions and employees.

----------


## Memnoch1207

Look in the database to see if the name is being inserted into the table.

----------


## TSAR

Sorry, no.

----------


## TSAR

I debugged it and in the function Query i get an exception : "Cannot insert the value NULL into column 'InActive', table 'VBFORUMS.dbo.Department'; column does not allow nulls. INSERT fails.
The statement has been terminated."

I modified this field so it would accept null value, but then i get this error :
"Cannot insert the value NULL into column 'DepartmentID', table 'VBFORUMS.dbo.Department'; column does not allow nulls. INSERT fails.
The statement has been terminated."

Do you see the problem ?

----------


## Memnoch1207

Set the default value of the InActive field to 0.

----------


## TSAR

Still ""Cannot insert the value NULL into column 'DepartmentID', table 'VBFORUMS.dbo.Department'; column does not allow nulls. INSERT fails.
The statement has been terminated.""

----------


## Memnoch1207

DepartmentID
Data Type: UniqueIdentifier
Default Value: (newid())
IsRowGUID: Yes

This should be the default of all of the Primary key fields in all three tables.
The default value for all varchar fields should be set to ('')
The default value for all int fields should be set to (0)

----------


## TSAR

Works fine, thanks !

----------


## anasalama

The problem still happens with the employee entry form.!
when i fill the form and submit it nothing is saved in the table.
i put the initial values of the table fileds as you said but i still face the problem !!
?

----------


## Anddmx

HI

I have question about the tutorial I made database named project from query on the .sql file and it created the table and everthing fine.
When I access the webpages file in IE but when i Click on Department it takes forever then errors out. He is the error

Error: SQL Server does not exist or access denied.
at System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) at System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) at System.Data.SqlClient.SqlConnection.Open() at System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState) at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at ASPNETTesting.DataManipulationLayer.Query(String strProcedureName) in C:\Inetpub\wwwroot\www01\ASPNETTesting\clsDML.vb:line 29 


I check the permissions on the database and the user I add to it was on there with admin rights. looked at the clsDML.vb and seen this line where it connects to the Sql server.

Public strConnectionString As String = "Server=(local);Database=Project;User ID=steve;Password=jensen;"

So I changed it to this to try and tried to connect the sql server but it didnt work.

Public strConnectionString As String = "Server=(local);Database=Project;User ID=admin;Password=xdmzx3065;"

thanks for the great tutorial so I am no expert but just trying to learn about asp.net with Sql server 

Anddmx

----------


## Memnoch1207

Make sure "Admin" is a valid user on the Project database, if not create it.

----------


## jignesh_1508

i want to create a new website on which user can serch for job in short job serching web site .for this website i can't get idea what will be the different tables,database etc.. is anyone help me!!!

----------


## jignesh_1508

how can i create dynamic header and footer for website ?? in asp.net??

----------


## angelica

Hi I have downloaded ASP.net testing tutorial and built the conversion alothough it says that .vbproj was not converted successfully.  

When I try to run the I get .

an error message saying :
Cannot open the file

How do I proceed from there please?

I am using VS 2005 . Thanks

----------


## HowTo

i am also having the same problem..

is the start up page properly defined?

or need to set it up???

please help

----------


## gep13

Hey,

With all respect, this tutorial is targeted at an older version of SQL Server and Visual Studio.  Unless you are specifically using these versions,  I would suggest you look elsewhere for samples, there are plenty available.

Gary

----------

