Category - SQL Server
19 Feb 2008
4 Comments   79167 Views
Here Mudassar Ahmed Khan has explained how to use parameterized queries to query SQL Server database in order to avoid SQL Injection attacks
09 Feb 2009
2 Comments   18762 Views
here Mudassar Ahmed Khan explain Parameterized Queries ADO.Net
12 Feb 2009
5 Comments   36118 Views
Send SMTP Email using SQL Server
19 Feb 2009
78 Comments   205477 Views
Here Mudassar Ahmed Khan has explained how to save file as binary data inside SQL Server database and also how to retreive them and reconvert to their respective formats using VB.net amd C#.
21 Feb 2009
49 Comments   299594 Views
Here Mudassar Ahmed Khan has explained how to retrieve and display images that are stored in SQL Server Database in ASP.Net Web application
08 Mar 2009
24 Comments   84825 Views
Here Mudassar Ahmed Khan has described how to easily send automated email notifications from the SQL Server database using job schedular
08 Apr 2009
49 Comments   158480 Views
Mudassar Ahmed Khan has explained how to save file to database directly using File Upload Control in ASP.Net
20 Apr 2009
36 Comments   73565 Views
Here Mudassar Ahmed Khan has described how to store images on disk and their path in images and then display them in GridView control in ASP.Net. Thus making your own Image or Picture Gallery
20 Apr 2009
30 Comments   242895 Views
Here Mudassar Ahmed Khan has explained how to build an Image Gallery to display images from SQL Server Database using the GridView control in ASP.Net
23 Apr 2009
14 Comments   108824 Views
Here Mudassar Ahmed Khan has explained how to Export a GridView with Images or Pictures to Word Excel or PDF Formats in ASP.Net. In this article the GridView is displaying images stored on disk and th
07 May 2009
3 Comments   19981 Views
Here Mudassar Ahmed Khan has explained how to create modify and delete Stored Procedures in Microsoft SQL Server Database
08 May 2009
0 Comments   75751 Views
Here Mudassar Ahmed Khan has explained how to resolve the exception A network-related or instance-specific error occurred while connecting to SQL Server Database
09 May 2009
0 Comments   26907 Views
Here Mudassar Ahmed Khan has explained how to resolve the exception SQL Network Interfaces error: 26 - Error Locating ServerInstance Specified while connecting to SQL Server Database.
09 May 2009
2 Comments   28971 Views
Here Mudassar Ahmed Khan has explained How to retrieve column names from a database table using SQL Query in SQL Server Database
13 May 2009
0 Comments   24862 Views
Here Mudassar Ahmed Khan has explained how to dynamically pass table name to SQL Query or Stored Procedure in SQL Server 2000 2005 2008
24 May 2009
0 Comments   11897 Views
Here Mudassar Ahmed Khan has explained how to transfer or publish your ASP.Net website database from your local machine onto the server by creating a database backup in SQL Server
26 May 2009
14 Comments   52352 Views
Here Mudassar Ahmed Khan has explained how to call Insert SQL Server Stored Procedures using ADO.Net in as ASP.Net Web Application
26 May 2009
7 Comments   33129 Views
Here Mudassar Ahmed Khan has explained how to call Select SQL Server Stored Procedures using ADO.Net in as ASP.Net Web Application and also how to bind the data returned by the stored procedures to AS
27 May 2009
6 Comments   73753 Views
Here Mudassar Ahmed Khan has explained how to get ID of newly inserted record in ASP.Net Web application using ADO.Net
29 May 2009
8 Comments   36287 Views
Here Mudassar Ahmed Khan has explained how to call stored procedures that update the data in SQL Server Database using ADO.Net
06 Jun 2009
39 Comments   141117 Views
Here Mudassar Ahmed Khan has explained how to import Excel Sheet Data into SQL Server Database table using ADO.Net in an ASP.Net Web application
06 Jun 2009
12 Comments   79108 Views
Here Mudassar Ahmed Khan has provided solutions to the issue The OLE DB provider ampquotMicrosoft.Ace.OLEDB.12.0ampquot for linked server ampquot(null)ampquot reported an error. Access denied. while
16 Aug 2009
0 Comments   70002 Views
Here Vinz has explained how to Save and Retrieve Dynamic TextBox values in GridView to SQL Server Database in ASP.Net Web Application
22 Sep 2012
11 Comments   69016 Views
Here Mudassar Ahmed Khan has explained how to call Select SQL Server Stored Procedures using ADO.Net in as ASP.Net Web Application and also how to bind the data returned by the stored procedures to ASP.Net GridView.
23 Sep 2012
2 Comments   65017 Views
Here Mudassar Ahmed Khan has explained how to bind data to GridView using Stored Procedure in ASP.Net
23 Sep 2012
0 Comments   15019 Views
Here Mudassar Ahmed Khan has explained with an example with attached sample source code, how to use SQLCommand ExecuteReader function to fetch data from SQL Server database in ASP.Net using C# and VB.Net and ADO.Net
26 Sep 2012
3 Comments   36263 Views
Here Mudassar Ahmed Khan has explained with an example with attached sample source code, how to bind GridView with data using SQLCommand DataReader in ASP.Net with C# and VB.Net.
28 Sep 2012
14 Comments   93104 Views
Here Mudassar Ahmed Khan has explained how to upload and store MP3 Audio Files to database and then retrieve it and display in ASP.Net GridView with Play and Download option using C# and VB.Net.
For playing the MP3 Audio files he has used Flash Music player
05 Oct 2012
6 Comments   55127 Views
Here Mudassar Ahmed Khan has explained with an example and attached sample code, how to bind and populate ASP.Net GridView from SQL Server DataBase using SqlDataSource programmatically from code behind class using C# and VB.Net.

Here he has created the SQLDataSource in code behind dynamically and also setting the properties of SQLDataSource such as ID, ConnectionString and SelectCommand.
20 Dec 2012
1 Comments   56660 Views
Here Mudassar Ahmed Khan has explained with an example and attached sample code, how to Import Excel Sheet data and records into SQL Server 2005, 2008, 2012 using ASP.Net
20 Dec 2012
0 Comments   8052 Views
Here Mudassar Ahmed Khan has explained with an example and attached sample code, how to upload data or records from Excel File after reading sheet contents to SQL Server in ASP.Net.
14 Jan 2013
10 Comments   46941 Views
Mudassar Ahmed Khan has explained with an example and attached sample code,
how to insert Word (.DOC and .DOCX) and excel document files into SQL Server Database directly using File Upload Control in ASP.Net
14 Jan 2013
0 Comments   9982 Views
Here Mudassar Ahmed Khan has explained with an example and attached sample code, how to Import or insert Excel Sheet data and records into SQL Server 2005, 2008, 2012 using ASP.Net
09 Feb 2013
4 Comments   33305 Views
Here Mudassar Ahmed Khan has explained how to download and install the Microsoft's Northwind and Pubs databases and then attach them to the SQL Server database server using the SQL Server Management Studio.
04 Mar 2013
2 Comments   23862 Views
Here Mudassar Ahmed Khan has explained with an example and attached sample code, how to populate Google Maps V3 with Multiple Markers using Address Latitude and Longitude values stored in SQL Server database in ASP.Net Website.
07 Mar 2013
22 Comments   71076 Views
Here Mudassar Ahmed Khan has explained with an example and attached sample code, how to populate Google Maps V3 with Multiple Markers using SQL Server database in ASP.Net Website.
31 Mar 2013
11 Comments   70874 Views
Here Mudassar Ahmed Khan has explained with an example and attached sample code:-
1. How to upload and save videos to database in binary data format in ASP.Net using C# and VB.Net
2. How to retrieve videos from database and play with live streaming using Flash Video Player.
31 Mar 2013
4 Comments   71479 Views
Here Mudassar Ahmed Khan has explained with an example and attached sample code, how to return the value of Identity (Auto Increment) Column value after record is inserted in SQL Server database using ADO.Net with C# and VB.Net.
31 Mar 2013
12 Comments   92752 Views
Here Mudassar Ahmed Khan has explained with an example and attached sample code, how to upload and save (insert) images to SQL Server Database in ASP.Net using C# and VB.Net.
14 Apr 2013
3 Comments   20585 Views
Here Mudassar Ahmed Khan has explained with an example and attached sample code, how to upload and save files to SQL Server Database table using File Upload control and then display the saved files in ASP.Net GridView with Download button, to download the saved file from database
23 May 2013
2 Comments   46222 Views
Here Mudassar Ahmed Khan has explained with an example and attached sample code, how to to pass value to SelectParameter of SqlDataSource using QueryString Parameter in the URL and filter the result of SqlDataSource in ASP.Net GridView.
24 May 2013
8 Comments   29058 Views
Here Mudassar Ahmed Khan has explained with an example, how to create modify and delete Stored Procedures in Microsoft SQL Server Database using SQL Server Management Studio.
24 May 2013
0 Comments   19503 Views
Here Mudassar Ahmed Khan has explained with an example and attached sample code, how to dynamically populate Title and Meta Tags like Keywords from and Description database and programmatically add to page head section in ASP.Net
18 Jun 2013
18 Comments   68919 Views
Here Mudassar Ahmed Khan has explained with an example and attached sample code, how to save and retrieve images on disk and using their path in SQL Server database and then display them in GridView control in ASP.Net.
19 Jun 2013
24 Comments   68935 Views
Here Mudassar Ahmed Khan has explained with an example and attached sample code, how to upload files to database in asp.net using FileUpload control and then download saved or stored files from SQL Server database using GridView control
29 Jun 2013
0 Comments   23378 Views
Here Mudassar Ahmed Khan has explained with an example and attached sample code, how to make use of ASP.Net AJAX Control Toolkit CascadingDropDown control in ASP.Net Website.

Three AJAX Cascading Dropdowns along with the three corresponding ASP.Net DropDownLists will be populated from SQL Server database with values of Country State City using Web Service and Web Methods.

On Page Load list of Countries is populated, when Country is selected, the list of States will be populated, and when a State is chosen list of Cities will be populated, thus at the end we get a Country, State and City Cascading DropDownLists implemented using ASP.Net AJAX CascadingDropDown control and SQL Server database.

Finally the article also explains how to access the values of the ASP.Net AJAX CascadingDropDown DropDownList Server Side on button click.
02 Jul 2013
3 Comments   38146 Views
Here Mudassar Ahmed Khan has explained with an example and attached sample code, how to make use of ASP.Net AJAX Control Toolkit CascadingDropDown control in ASP.Net Website.

Three AJAX Cascading Dropdowns along with the three corresponding ASP.Net DropDownLists will be populated from SQL Server database with values of Country State City using Web Service and Web Methods.

On Page Load list of Countries is populated, when Country is selected, the list of States will be populated, and when a State is chosen list of Cities will be populated, thus at the end we get a Country, State and City Cascading DropDownLists implemented using ASP.Net AJAX CascadingDropDown control and SQL Server database.

Finally the article also explains how to access the values of the ASP.Net AJAX CascadingDropDown DropDownList Server Side on button click.
17 Jul 2013
0 Comments   4751 Views
Here Mudassar Ahmed Khan has explained how to

1. Use the SQL Server 2008 Time Data Type and define its columns in Tables.
2. Understanding the precision in Time Data Type.
3. Get Current System Time.
4. How to insert Time Values using SQL Query into Tables.

In order to explain the concept practically I have created a Table named as Meetings which is used to reserve Meeting Room by various employees in the company
17 Aug 2013
1 Comments   49322 Views
Here Mudassar Ahmed Khan has explained with an example, how to populate and display Google Maps V3 with Multiple Markers using the Latitude and Longitude stored in database in ASP.Net Website.
18 Aug 2013
1 Comments   30382 Views
Here Mudassar Ahmed Khan has explained, how to dynamically add meta tags in ASP.Net Website.

The dynamic meta tags will be populated from database and each meta tag will be added dynamically to head section of page.
24 Aug 2013
0 Comments   34065 Views
Here Mudassar Ahmed Khan has explained, how to add Meta Tags in Master Page, Child Content Pages (ASPX).

The Title and Meta Tags like Keywords from and Description are dynamically populated from database and programmatically added to head section of the Master Page in ASP.Net.
26 Aug 2013
1 Comments   4258 Views
Here Mudassar Ahmed Khan has explained how to

1. Use the SQL Server 2008 Time Data Type and define its columns in Tables.
2. Understanding the precision in Time Data Type.
3. Get Current System Time.
4. How to insert Time Values using SQL Query into Tables.

In order to explain the concept practically I have created a Table named as Meetings which is used to reserve Meeting Room by various employees in the company
16 Sep 2013
12 Comments   91098 Views
Here Mudassar Ahmed Khan has explained how to use and return value from Stored Procedure using Output Parameter in ASP.Net.

For this article I a Table named Fruits is used which contains FruitId and FruitName columns. The name of the Fruit is fetched using Output Parameter in SQL Server Stored Procedure in ASP.Net
29 Nov 2013
5 Comments   62180 Views
Here Mudassar Ahmed Khan has explained how to display images stored in database in ASP.Net Image control without using Generic HTTP Handler.

The images stored as Binary data will be fetched as BYTE Array and then the BYTE Array will be converted to BASE64 string and then assigned to the ASP.Net image control.
05 Apr 2014
0 Comments   14704 Views
Here Mudassar Ahmed Khan has explained how to send email from database using stored procedure in SQL Server.
This technique makes use of Collaboration Data Objects (CDO) for sending email messages which works in most SQL Server versions 2000, 2008, 2008R2 and 2012.
22 Apr 2014
0 Comments   8270 Views
Here Mudassar Ahmed Khan has explained how to use and pass parameters to dynamic SQL in SQL Server.
22 Apr 2014
5 Comments   14738 Views
Here Mudassar Ahmed Khan has explained SQL Injection attack, how SQL is injected to hack your system with example, how can we prevent SQL Injection and what are the possible prevention mechanisms and techniques to make ASP.Net websites safe from SQL Injection attacks.
30 Apr 2014
3 Comments   28361 Views
Here Mudassar Ahmed Khan has explained how to upload and save PDF files to SQL Server Database table using File Upload control and then retrieve and display the PDF Files from database in browser.

The PDF File will be embedded in browser and displayed using HTML OBJECT tag.
08 Jun 2014
2 Comments   18551 Views
Here Mudassar Ahmed Khan has explained how to use SqlBulkCopy to insert bulk data from GridView to database in ASP.Net.

SqlBulkCopy class as the name suggests does bulk insert from one source to another and hence multiple selected rows from the GridView can be easily read and inserted in SQL Server database table using the SqlBulkCopy class.
12 Jun 2014
5 Comments   14162 Views
Here Mudassar Ahmed Khan has explained how to send or pass DataTable as parameter to Stored Procedure in C# and VB.Net using the SQL Server User Defined Table Type.

The User Defined Table Type has to be created in SQL Server and it must have the same schema as that of the DataTable that we need to pass to the Stored Procedure as parameter.
25 Jun 2014
0 Comments   7979 Views
Here Mudassar Ahmed Khan has explained how to download and install the Microsoft's Northwind and Pubs databases and then attach them to the SQL Server or SQL Server Express editions.

The Northwind and Pubs databases are available for free by Microsoft and can be downloaded and used in any SQL Server or SQL Server Express version namely 2005, 2008, 2008R2 or 2012.
03 Jul 2014
3 Comments   16049 Views
Here Mudassar Ahmed Khan has explained how to read and write BLOBs (Binary Large Objects) data to SQL Server database using C# and VB.Net.

BLOBs include files such as Images, PDF, Word or Excel Documents, Audio, Video files. Such files are read converted to an array of bytes and inserted into SQL Server VARBINARY or IMAGE fields.
16 Jul 2014
1 Comments   4937 Views
Here Mudassar Ahmed Khan has explained with an example, how to pass Table Valued Parameters to SQL Server Stored Procedure from .Net Code Behind using ADO.Net, C# and VB.Net.
29 Jul 2014
1 Comments   12687 Views
Here Mudassar Ahmed Khan has explained how to populate (bind) TreeView control with Nodes having Parent Child relationship from database in ASP.Net using C# and VB.Net.

The TreeView will be populated using recursion.
05 Aug 2014
1 Comments   8791 Views
Here Mudassar Ahmed Khan has explained how to pass multiple records (rows) to a Stored Procedure in SQL Server using C# and VB.Net.
We can pass a Table containing multiple records (rows) to a Stored Procedure by making use of Table Valued parameters in SQL Server.
10 Aug 2014
2 Comments   12260 Views
Here Mudassar Ahmed Khan has explained how to upload and insert XML file data using Stored Procedure in ASP.Net using C# and VB.Net.

SQL Server 2005 onwards we can pass a parameter of XML data type to the Stored Procedure and also we can easily parse the XML and extract its attribute and Inner Text of tags.
11 Aug 2014
0 Comments   4727 Views
Here Mudassar Ahmed Khan has explained how to save file as binary data inside SQL Server database and also how to retrieve them and convert them back to their respective formats using C# and VB.Net.
11 Aug 2014
0 Comments   6084 Views
Here Mudassar Ahmed Khan has explained how to save image as binary data into SQL Server database and also how to retrieve and convert the image back to their respective formats using C# and VB.Net.
22 Aug 2014
0 Comments   5494 Views
Here Mudassar Ahmed Khan has explained how to pass XML file as parameter to Stored Procedure in C# and VB.Net.
23 Aug 2014
0 Comments   8635 Views
Here Mudassar Ahmed Khan has explained how to populate or bind TreeView from database in ASP.Net using C# and VB.Net.
08 Sep 2014
1 Comments   14628 Views
Here Mudassar Ahmed Khan has shared with an example, a function to split a string in SQL Server 2005, 2008 and 2012 versions. The string containing words or letters separated (delimited) by comma will be split into Table values.

He has also explained how to use the Split function to split a string in a SQL Query or Stored Procedures in SQL Server 2005, 2008 and 2012 versions.
18 Sep 2014
0 Comments   8481 Views
Here Mudassar Ahmed Khan explained how to split and convert a comma separated / delimited string to a table in SQL Server using Split function.
18 Sep 2014
1 Comments   6630 Views
Here Mudassar Ahmed Khan explained how to insert comma separated / delimited values in a table in SQL Server using Split function.
24 Sep 2014
1 Comments   10632 Views
Here Mudassar Ahmed Khan has explained how to export data (records) from SQL Server Table to Excel file in ASP.Net using C# and VB.Net. This article will work for all SQL Server versions i.e. 2005, 2008, 2008R2, 2012, etc.

The data will be first fetched into a DataTable and then the DataTable will be exported into an Excel Sheet using OpenXml and ClosedXml Excel libraries.
24 Sep 2014
0 Comments   5962 Views
Here Mudassar Ahmed Khan has explained how to export data (records) from SQL Server Table to CSV file in ASP.Net using C# and VB.Net. This article will work for all SQL Server versions i.e. 2005, 2008, 2008R2, 2012, etc.

The data will be first fetched into a DataTable and then the DataTable will be exported to a CSV file.
24 Sep 2014
0 Comments   5923 Views
Here Mudassar Ahmed Khan has explained how to export data (records) from SQL Server Table to Text (Notepad) file in ASP.Net using C# and VB.Net. This article will work for all SQL Server versions i.e. 2005, 2008, 2008R2, 2012, etc.

The data will be first fetched into a DataTable and then the DataTable will be exported to a Text file which can be viewed in Notepad.
03 Oct 2014
1 Comments   14668 Views
Here Mudassar Ahmed Khan has explained how to import / upload CSV file data to SQL Server database in ASP.Net using C# and VB.Net.

The CSV file data will be inserted into SQL Server database table using the SqlBulkCopy class.
14 Nov 2014
0 Comments   7284 Views
Here Mudassar Ahmed Khan has explained how to create an Excel file using the data (records) from SQL Server Table and then download it in ASP.Net using C# and VB.Net.
02 Dec 2014
1 Comments   3057 Views
Here Mudassar Ahmed Khan explained how to pass comma separated (delimited) values as Parameter to Stored Procedure in SQL Server.

The comma separated (delimited) values will be split into Table rows and will be used for querying inside the SQL Server Stored Procedure.
13 Dec 2014
3 Comments   3669 Views
Here Mudassar Ahmed Khan has explained how to insert (save) Hindi, Marathi, Gujarati, Urdu, Persian, Arabic, Tamil and Telugu languages Text characters in SQL Server database using ASP.Net, C# and VB.Net.

In SQL Server database we will need to use NVARCHAR data type to store the various languages text characters.
23 Dec 2014
1 Comments   5229 Views
Here Mudassar Ahmed Khan has shared a tutorial that explains the SqlHelper class of Microsoft Data Access Application Block in ASP.Net with examples in C# and VB.Net.

SqlHelper class can be downloaded by downloading the Microsoft Data Access Application Block and it is a great utility that helps us to reduce ADO.Net code used in day to day programming.
26 Dec 2014
1 Comments   4050 Views
Here Mudassar Ahmed Khan has explained how to build a Database driven ASP.Net Menu control i.e. dynamically populating Menu items from the database in ASP.Net using C# and VB.Net.

The Menu items will be populated from database using recursion.
27 Dec 2014
0 Comments   3732 Views
Here Mudassar Ahmed Khan has explained how to perform Bulk Insert records and Update existing rows if record exists using C# and VB.Net.

SqlBulkCopy as the name suggest is for copying (inserting) bulk records and it cannot perform update operation. Hence comes Table Valued Parameter to the rescue, which allows us to pass multiple records using a DataTable to a Stored Procedure where we can do the processing.
29 Dec 2014
0 Comments   1466 Views
Here Mudassar Ahmed Khan has explained a step by step tutorial to backup database in SQL Server Management Studio 2005, 2008, 2008R2 and 2012.
29 Dec 2014
0 Comments   1113 Views
Here Mudassar Ahmed Khan has explained how to upload your existing SQL Server database to Plesk panel in Shared hosting.
14 Jan 2015
0 Comments   1095 Views
Here Mudassar Ahmed Khan has explained how to insert (save) Hindi, Marathi, Gujarati, Urdu, Persian, Arabic, Tamil, Telugu, Chinese (Mandarin) and Japanese languages Text characters in SQL Server database versions 2005, 2008, 2008R2 and 2012.

In SQL Server database we will need to use NVARCHAR data type to store the various regional languages text characters like Indian, Arabic, Persian, Chinese (Mandarin), Japanese, etc.
25 Jan 2015
0 Comments   1777 Views
Here Mudassar Ahmed Khan has explained how to bulk copy data from DataTable (DataSet) to SQL Server database Table using SqlBulkCopy in C#, VB.Net and ASP.Net.
25 Jan 2015
0 Comments   3012 Views
Here Mudassar Ahmed Khan has explained how to save (insert) dynamic TextBox Value (Text) to SQL Server database table in ASP.Net using C# and VB.Net.
11 Feb 2015
0 Comments   653 Views
Here Mudassar Ahmed Khan has explained how to download and install Microsoft Northwind Sample database in MySql. Microsoft’s Northwind database is available for SQL Server and MS Access but it is not available for download for MySql.

Instead of spending time in converting the SQL Server database to MySql, I’ll be making use of a SQL Script to create the Northwind database in MySql.
17 Feb 2015
0 Comments   950 Views
Here Mudassar Ahmed Khan has explained with simple examples, how to write Insert, Update and Delete Triggers in SQL Server.

This tutorial is applicable for all versions of SQL Server i.e. 2005, 2008, 2012, 2014, etc.
17 Feb 2015
0 Comments   720 Views
Here Mudassar Ahmed Khan has explained with simple example, how to write an Insert Of Delete Trigger in SQL Server.

This tutorial is applicable for all versions of SQL Server i.e. 2005, 2008, 2012, 2014, etc.
18 Feb 2015
0 Comments   735 Views
Here Mudassar Ahmed Khan has explained with simple example, how to write an Instead Of Insert Trigger in SQL Server.

This tutorial is applicable for all versions of SQL Server i.e. 2005, 2008, 2012, 2014, etc.
19 Feb 2015
0 Comments   768 Views
Here Mudassar Ahmed Khan has explained with simple example, how to write an Instead Of Update Trigger in SQL Server.

This tutorial is applicable for all versions of SQL Server i.e. 2005, 2008, 2012, 2014, etc.
06 Mar 2015
0 Comments   742 Views
Here Mudassar Ahmed Khan has explained a tutorial to use the ASP.Net TreeView control in ASP.Net with examples in C# and VB.Net.
08 Mar 2015
0 Comments   968 Views
Here Mudassar Ahmed Khan has explained how to bind and display hierarchical data with TreeView in ASP.Net using C# and VB.Net.
25 Mar 2015
0 Comments   578 Views
Here Mudassar Ahmed Khan has explained how to return all records when Parameter used to filter the results in a SQL Query is blank (empty) or Null in SQL Server.