Menu ▼


<< < 1 2 > >>

Sometimes when you done changes in table columns and save, you will get the below error

Saving changes is not permitted. The changes you have made require the following tables to be dropped and re-created. You have either made changes to a table that can't be re-created or enabled the option Prevent saving changes that require the table to be re-created.

To resolve this issue simple do the below two setps.

  • Goto "Tools" -> Open "Options"
    SQL Tools Options
  • Select "Designers" -> "Table and Database Designers" and Uncheck the checkbox "Prevent saving changes that require table re-creation" and click "OK"
    Prevent saving changes that require table re-creation

Read More...
Submited By : mrkraju On 12 Feb 2016

To set specific rules on the data in a table column we will use SQL Constraints. When DML (Insert, Update, Delete) operation is performed on the table data, SQL server will check the constraints and it will not allow to perform the operation if the data not satisfies the constraints.

SQL server supports the following type of constraints.

1. NOT NULL : Column cannot store NULL value.

2. CHECK : Column data satisfies the specified condition.

3. UNIQUE : Column data contains different values (will not allow duplicate value).

4. PRIMARY KEY : Combination of UNIQUE and NOT NULL. Column cannot have NULL and duplicate value.

5. FOREIGN KEY : Allows data having reference with another table. Also allow NULL values.

6. DEFAULT : Insert a default value for the column when no data specified.

Read More...
Submited By : mrkraju On 31 Aug 2015

Below are the differences between Primary Key and Foreign Key.

Primary Key Foreign Key
It will not allow NULL values. It will allow NULL values.
Primary Key can not contain duplicate values. Foreign Key allows duplicate values.
A table can have only one Primary Key. A table can have multiple Foreign Keys.
Clustered index will be created by defauult. Index will not be created automatically, need to be created manually.
Read More...
Submited By : mrkraju On 18 Jul 2015

Step1: In web.config file Write the following code

<system.web>

<customErrors mode="On">

          <error statusCode="404" redirect="PageNotFound.aspx" />

          <error statusCode="403" redirect="PageNotFound.aspx" />

      </customErrors>

</system.web>

 <system.webServer>

<httpErrors errorMode="Custom" existingResponse="Replace">

          <remove statusCode="404" />

          <remove statusCode="403" />

      <error statusCode="404" path="PageNotFound.aspx" responseMode="Redirect" />

      <error statusCode="403" path="PageNotFound.aspx" responseMode="Redirect" />

      </httpErrors>

</system.webServer>


Step2: Settings need to be updated in IIS7

 1) Open IIS

2) Select your application

3) Open Error Pages under the IIS section -> clicks Open Features


 

4) After clicking Open Features tab we will get below shown window. Now click Edit Feature Settings tab



Then we will get below shown window,



In the above window select radio button Custom Error Pages àok

 

_Step3:

_Open the file:

C:\Windows\System32\inetsrv\config\applicationHost.config
_And change:

<section name="httpErrors" overrideModeDefault="Deny" />
_To:

<section name="httpErrors" overrideModeDefault="Allow" />

 

Read More...
Submited By : Learn DotNet On 22 Dec 2013

                            Steps to Attach & Detach Database.

 How to Attach & Detach .mdf and .ldf files: 

Follow the steps mentioned below: 

  • Open Sqlserver Management Studio and select the database from the databases tree view  and right click on the selected database   which you want to Detach.
  • Select All tasks > Detach Database from the drop down menu options


  • Following Dialog box will appear.


 
  • Now click on OK .The database successfully is detached, Once the database is detached, that database name will not be shown under databases tree view
  •  Note: Attach &Detach Operations can be done when the Database is not in use.when it is in usage then it will not allow to proceed and the following error message will appear

    • Now copy the .mdf and .ldf files of the database from the location (example: C:\Program Files\Microsoft SQL Server\MSSQL\Data) as shown in the following diagram 
    • Paste the copied files (mdf & ldf) into the new location or new disk. 
    • Right click on Databases  and select option  All Tasks > Attach Database from Drop down


  • The following dialog box will appear prompting for MDF file location


  • Click on add and select mdf and ldf files which were stored.


  • Select the Data based and On Clicking ‘OK’, the data base will be attached  


Read More...
Submited By : Learn DotNet On 19 Dec 2013

Restore of Database:

 Step 1:  Open Sql Server Management Studio and connect the database engine.

 

Step 2: Enter the To Database name.


Step 3:Select From Device and click on the browse button, then the following window will appear


Step 4:Click on Add Button , then the following window will appear

 

Step 5:. After selecting the backup file the following window appear.

Step 6: Click on OK Button in the above window then the following window will appear

 

Step 7: Select Restore button and  Select Options tab from the above window, the following will appear.


Step 10: select Overwrite the existing database option and then click on OK button 

Step 11: then you will find the below window says, Restore of database ‘Test’ completed successfully and then click on ok, then go to the database you will find all the tables, views, Stored procedures and etc.


Read More...
Submited By : Learn DotNet On 18 Dec 2013

Backup of Database:

Step 1: Right on the Database for i.e Test  - > All Tasks -> Backup 


Step 2: when clicked on Backup Database, the below will open, if you want Remove the Existing path , and click on “Add” button



Step 3: when clicked on add button, the below window will open, and click on the highlighted button.


Step 4: After clicking the highlighted button, the below window will open, select the location for saving the file and give the file name i.e. Test, click on ok


Step 5:  the below window open, and click on OK button.

Step 6: after clicking on OK button, the below window will open, then click on ok

Step 7: after clicking on ok, the below window will open, saying that “back up operation has been completed successfully”, you can find the file in the specified location.



Read More...
Submited By : Learn DotNet On 18 Dec 2013

Opening a database connection is a resource intensive and time consuming operation. Connection pooling increases the performance of Web applications by reusing active database connections instead of creating a new connection with every new request. Pool manager maintains a pool of open database connections. When a new connection requests come in, the pool manager checks if the pool contains any unused connections and returns one if available. If all the connections in the pool are busy and the maximum pool size has not been reached, the new connection is created and added to the pool. When the pool reaches its maximum size all new connection requests are being queued up until a connection in the pool becomes available or the connection attempt times out.

Connection pooling behavior is controlled by the connection string parameters. The following are four parameters that control most of the connection pooling behavior:

Connect Timeout - controls the wait period in seconds when a new connection is requested, if this timeout expires, an exception will be thrown. Default is 15 seconds.

Max Pool Size - specifies the maximum size of your connection pool. Default is 100. Most Web sites do not use more than 40 connections under the heaviest load but it depends on how long your database operations take to complete.

Min Pool Size - initial number of connections that will be added to the pool upon its creation. Default is zero; however, you may chose to set this to a small number such as 5 if your application needs consistent response times even after it was idle for hours. In this case the first user requests won't have to wait for those database connections to establish.

Pooling - controls if your connection pooling on or off. Default is true. Pooling=false.

Read More...
Submited By : Krishna Narra On 01 Dec 2013

Application Pool is one of the new and very good feature in IIS 6. Application pools are used in isolating Web applications from one another and thereby increasing the reliability of your ASP.NET Web applications. Application pools allow us to make the asp.net web applications robust.

An Application Pool contains one or more web applications and allows us to configure a level of isolation between different Web applications. If we want to isolate all the Web applications running in the same computer, we can do this by creating a separate application pool for each Web application and keep them in their corresponding application pool. Because each application pool runs in its own worker process, errors in one application pool will not affect the applications running in other application pools. Deploying applications in application pools is a primary advantage of running IIS 6.0 in worker process isolation mode because you can customize the application pools to achieve the degree of application isolation that you need.

Read More...
Submited By : Krishna Narra On 01 Dec 2013

A namespace is just a grouping of related classes. It's a method of putting classes inside a container so that they can be clearly distinguished from other classes with the same name. A namespace is a logical grouping rather than a physical grouping. 

Design patterns are just convenient ways of reusing object-oriented code between projects and between programmers. The idea behind design patterns is simple write down and catalog common interactions between objects that programmers have frequently found useful.

Read More...
Submited By : Krishna Narra On 01 Dec 2013
<< < 1 2 > >>




Search dotnetlearners.com