Category - SQL Server
4 Comments   114683 Views
Here Mudassar Ahmed Khan has explained how to use parameterized queries to query SQL Server database in order to avoid SQL Injection attacks
2 Comments   25682 Views
here Mudassar Ahmed Khan explain Parameterized Queries ADO.Net
5 Comments   43006 Views
Send SMTP Email using SQL Server
79 Comments   267654 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#.
52 Comments   466423 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
24 Comments   114590 Views
Here Mudassar Ahmed Khan has described how to easily send automated email notifications from the SQL Server database using job schedular
49 Comments   204223 Views
Mudassar Ahmed Khan has explained how to save file to database directly using File Upload Control in ASP.Net
38 Comments   120082 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
31 Comments   325661 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
14 Comments   141973 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
3 Comments   25986 Views
Here Mudassar Ahmed Khan has explained how to create modify and delete Stored Procedures in Microsoft SQL Server Database
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
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.
2 Comments   43355 Views
Here Mudassar Ahmed Khan has explained How to retrieve column names from a database table using SQL Query in SQL Server Database
1 Comments   38719 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
0 Comments   16150 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
15 Comments   85115 Views
Here Mudassar Ahmed Khan has explained how to call Insert SQL Server Stored Procedures using ADO.Net in as ASP.Net Web Application
7 Comments   48863 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
6 Comments   98846 Views
Here Mudassar Ahmed Khan has explained how to get ID of newly inserted record in ASP.Net Web application using ADO.Net
8 Comments   51243 Views
Here Mudassar Ahmed Khan has explained how to call stored procedures that update the data in SQL Server Database using ADO.Net
40 Comments   176607 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
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
0 Comments   98375 Views
Here Vinz has explained how to Save and Retrieve Dynamic TextBox values in GridView to SQL Server Database in ASP.Net Web Application
11 Comments   102891 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.
4 Comments   98482 Views
Here Mudassar Ahmed Khan has explained how to bind data to GridView using Stored Procedure in ASP.Net
0 Comments   22173 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
3 Comments   56609 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.
17 Comments   146204 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
7 Comments   107536 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.
4 Comments   113186 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
0 Comments   9629 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.
10 Comments   73346 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
0 Comments   13470 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
4 Comments   58578 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.
2 Comments   32729 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.
24 Comments   132826 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.
12 Comments   144638 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.
4 Comments   106893 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.
14 Comments   154234 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.
3 Comments   28921 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
3 Comments   83643 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.
18 Comments   67316 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.
0 Comments   24718 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
19 Comments   119750 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.
30 Comments   128414 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
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.
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.
0 Comments   6526 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
6 Comments   92040 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.
2 Comments   47328 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.
0 Comments   45579 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.
1 Comments   6594 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 Comments   160897 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
10 Comments   127381 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.
0 Comments   29662 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.
0 Comments   14457 Views
Here Mudassar Ahmed Khan has explained how to use and pass parameters to dynamic SQL in SQL Server.
8 Comments   41483 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.
8 Comments   113946 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.
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.
10 Comments   35704 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.
0 Comments   19062 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.
3 Comments   45501 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.
3 Comments   17975 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.
1 Comments   25554 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.
1 Comments   26691 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.
3 Comments   40596 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.
0 Comments   14520 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.
1 Comments   27092 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.
0 Comments   23498 Views
Here Mudassar Ahmed Khan has explained how to pass XML file as parameter to Stored Procedure in C# and VB.Net.
0 Comments   32163 Views
Here Mudassar Ahmed Khan has explained how to populate or bind TreeView from database in ASP.Net using C# and VB.Net.
3 Comments   102112 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.
0 Comments   44209 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.
3 Comments   13454 Views
Here Mudassar Ahmed Khan explained how to insert comma separated / delimited values in a table in SQL Server using Split function.
5 Comments   40441 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.
1 Comments   24701 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.
0 Comments   26660 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.
3 Comments   54487 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.
2 Comments   40701 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.
2 Comments   15533 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.
3 Comments   14080 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.
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.
5 Comments   36241 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.
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.
0 Comments   4579 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.
0 Comments   2355 Views
Here Mudassar Ahmed Khan has explained how to upload your existing SQL Server database to Plesk panel in Shared hosting.
0 Comments   3698 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.
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.
0 Comments   21747 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.
0 Comments   5939 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.
9 Comments   61092 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.
0 Comments   4940 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.
0 Comments   2551 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.
0 Comments   8346 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.
0 Comments   15336 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.
0 Comments   12579 Views
Here Mudassar Ahmed Khan has explained how to bind and display hierarchical data with TreeView in ASP.Net using C# and VB.Net.
0 Comments   13065 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.
0 Comments   11940 Views
Here Mudassar Ahmed Khan has explained how to get scalar value return from a Stored Procedure in ADO.Net using ExecuteScalar method of the SqlCommand class in C# and VB.Net.
SqlCommand ExecuteScalar is a handy function when you want to just need one Cell value i.e. one column and one row.
Here Mudassar Ahmed Khan has explained a tutorial with example on how to modify (Alter) an existing Stored Procedure in SQL Server.
Using this tutorial you can easily modify (Alter) an existing Stored Procedure in all SQL Server versions i.e. 2000, 2005, 2008, 2008R2, 2012 and 2014.
Here Mudassar Ahmed Khan has explained with example the syntax to drop a Stored Procedure in SQL Server i.e. how to delete a Stored Procedure in SQL Server.
Using this tutorial you can easily delete (Drop) an existing Stored Procedure in all SQL Server versions i.e. 2000, 2005, 2008, 2008R2, 2012 and 2014.
Here Mudassar Ahmed Khan has explained with an example how to return value from a Stored Procedure in SQL Server. SQL Server allows to return a single integer value from a Stored Procedure using the RETURN keyword.
The Return keyword is supported in Stored Procedures of all SQL Server versions i.e. 2000, 2005, 2008, 2008R2, 2012 and 2014.
0 Comments   2291 Views
Here Mudassar Ahmed Khan has explained SQL Injection attack and some examples of SQL Injection in SQL Server.
0 Comments   32901 Views
Here Mudassar Ahmed Khan has explained how to write (insert) data to Excel file Sheet (.xls and .xlsx) in ASP.Net using C# and VB.Net.
The data from database will be written (inserted) into the Excel file Sheet (.xls and .xlsx) and the file will be downloaded in ASP.Net.
0 Comments   2908 Views
Here Mudassar Ahmed Khan has provided a tutorial with simple example that explains

- What are Cursors in SQL Server?
- What is the syntax for writing Cursors in SQL Server?
- How to write and use Cursors in SQL Server?
- Disadvantages of a Cursor in SQL Server.

Cursor is supported in all SQL Server versions i.e. 2000, 2005, 2008, 2008R2, 2012 and 2014.
Here Mudassar Ahmed Khan has explained with an example, how to return multiple values from a Stored Procedure in SQL Server.
Multiple values will be returned from Stored Procedure by returning comma separated (delimited) values using Output Parameter.

Output Parameter is supported in Stored Procedures of all SQL Server versions i.e. 2000, 2005, 2008, 2008R2, 2012 and 2014.
0 Comments   2505 Views
Here Mudassar Ahmed Khan has explained with an example, how to use the SQL Server COALESCE function to get comma separated (delimited) values from Table in SQL Server.
COALESCE function can be used to get comma separated (delimited) values from Table in the following SQL Server versions i.e. 2005, 2008, 2008R2, 2012 and 2014.
0 Comments   1865 Views
Here Mudassar Ahmed Khan has explained with an example, what is Stored Procedure in SQL Server, how to create (write) and use a Stored Procedure and finally the advantages of using Stored Procedure in SQL Server.

Stored Procedures are compatible in all SQL Server versions namely 2000, 2005, 2008, 2008R2, 2012 and 2014.
0 Comments   11514 Views
Here Mudassar Ahmed Khan has explained how to create and drop (delete) SQL Server Table programmatically using ADO.Net, C# and VB.Net.

The Create and Drop script will be dynamically generated and the Table will be respectively created or deleted in SQL Server database.
0 Comments   9092 Views
Here Mudassar Ahmed Khan has explained with example, how to read binary data files and convert them to their respective file formats and write the files as binary data and save it to database.
0 Comments   8161 Views
Here Mudassar Ahmed Khan has explained how to convert binary data to PDF file and display in browser in ASP.Net using C# and VB.Net.
1 Comments   15118 Views
Here Mudassar Ahmed Khan has explained how to perform Select, Insert, Edit, Update and Delete operations using a WCF Service and OperationContract methods in ASP.Net.
In order to illustrate, I’ll be using a GridView in which I will perform Insert, Edit, Update and Delete operations using a WCF Service in ASP.Net, C# and VB.Net.
1 Comments   3241 Views
Here Mudassar Ahmed Khan has explained with example, how to create Triggers in SQL Server that will insert data into another Table.
In some applications, we need to log the operations performed on tables and hence in such cases Triggers can be used to insert the records into the Log tables.
0 Comments   5032 Views
Here Mudassar Ahmed Khan has explained with example, how to get the Inserted, Updated and Deleted Row column values such as ID field in Insert, Update and Delete SQL Server Triggers.
This tutorial is applicable for all versions of SQL Server i.e. 2005, 2008, 2012, 2014, etc.
Here Mudassar Ahmed Khan has explained with example, how to save (insert) DropDownList Selected value to Database in ASP.Net using C# and VB.Net.
Here Mudassar Ahmed Khan has explained with an example, how to pass Table as parameter i.e. Table Valued Parameters to Stored Procedure in SQL Server.
The User Defined Table Type has to be created in SQL Server and it must have the same schema as that of the Table Valued parameter that we need to pass to the Stored Procedure.
Here Mudassar Ahmed Khan has explained with an example, how to implement Paging DataGridView in Windows Forms (WinForms) Application using C# and VB.Net.
DataGridView control in Windows Forms (WinForms) Application does not have paging capabilities and hence Custom Paging using Stored Procedure needs to be implemented.
0 Comments   1559 Views
Here Mudassar Ahmed Khan has explained the difference between @@IDENTITY, SCOPE_IDENTITY() and IDENT_CURRENT in SQL Server.
The @@IDENTITY, SCOPE_IDENTITY() and IDENT_CURRENT functions return the Identity value (ID value) of the newly (last) inserted record but still there exists a difference.
This article is applicable to SQL Server 2000, 2005, 2008, 2008R2, 2012 and 2014 versions.
Here Mudassar Ahmed Khan has explained how to return Identity value from Stored Procedure in SQL Server.
The Identity value (ID value) of the newly (last) inserted record can be determined using @@IDENTITY, SCOPE_IDENTITY() and IDENT_CURRENT functions.
This article is applicable to SQL Server 2000, 2005, 2008, 2008R2, 2012 and 2014 versions.
Here Mudassar Ahmed Khan has explained with an example, how to insert (save) multiple rows (records) from DataGridView to database in Windows Forms (WinForms) Application using C# and VB.Net.
0 Comments   6421 Views
Here Mudassar Ahmed Khan has explained how to upload bulk data (records) in SQL Server Database using XML file in ASP.Net using C# and VB.Net.
0 Comments   15699 Views
Here Mudassar Ahmed Khan has explained how to insert and retrieve images from SQL Server database without using Stored Procedures using C# and VB.Net.
0 Comments   1276 Views
Here Mudassar Ahmed Khan has explained with an example, the similarities and differences between LEN and DATALENGTH functions in SQL Server.
Both LEN and DATALENGTH functions as the name suggest are used to determine lengths, though they have some similarities they are still different from each other and have their own specific usage.
This article is applicable to SQL Server versions 2005, 2008, 2008R2, 2012, 2014 and higher.
Here Mudassar Ahmed Khan has explained with an example, how to assign (set) result value of EXEC function to Variable in SQL Server.
The capturing and assigning result value from EXEC function to a variable is supported in SQL Server versions i.e. 2000, 2005, 2008, 2008R2, 2012, 2014 or higher.
Here Mudassar Ahmed Khan has explained with an example, how to bind / fill/ populate DataTable from Database in ASP.Net using C# and VB.Net.
0 Comments   6971 Views
Here Mudassar Ahmed Khan has explained with an example, how to display and change image in Image control based on DropDownList selection in ASP.Net using C# and VB.Net.
When DropDownList selection is changed, 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.
Here Mudassar Ahmed Khan has explained with an example, how to perform Select, Insert, Update and Delete operations using a single Stored Procedure in SQL Server.
Performing Select, Insert, Update and Delete operations using a single Stored Procedure is supported in SQL Server versions i.e. 2005, 2008, 2008R2, 2012, 2014 or higher.
3 Comments   27413 Views
Here Mudassar Ahmed Khan has explained with an example, how to build a Database driven Twitter Bootstrap Responsive ASP.Net Menu control i.e. ASP.Net Menu control that works for Mobile Phone, Tablet and Desktop displays.
The ASP.Net Menu control items will be dynamically populated from database using C# and VB.Net.
2 Comments   16237 Views
Here Mudassar Ahmed Khan has explained with an example, how to insert (save) to SQL Server Table in C# and VB.Net using the SQL Server User Defined Table Type.
Here Mudassar Ahmed Khan has explained with an example, how to execute (run) Stored Procedure in SQL Server Management Studio.
The Stored Procedure can be easily called (executed) using the EXEC command in SQL Server Management Studio.
This method works for all versions for SQL Server Management Studio editions i.e. 2000, 2005, 2008, 2008R2, 2012, 2014 or higher including SQL Server Management Studio Express editions.
0 Comments   2303 Views
Here Mudassar Ahmed Khan has explained with an example, how to write and execute dynamic SQL Query in SQL Server.
Dynamic SQL Query can be executed using EXEC and sp_executesql commands in SQL Server.
Execution of dynamic SQL is supported in SQL Server versions i.e. 2000, 2005, 2008, 2008R2, 2012, 2014 or higher.
0 Comments   2278 Views
Here Mudassar Ahmed Khan has explained with an example, how to use the SQL Server sp_executesql command and how to pass parameters to sp_executesql command in SQL Server.
Dynamic SQL Query can be executed with parameters using the sp_executesql command in SQL Server.
The sp_executesql command is supported in SQL Server versions i.e. 2000, 2005, 2008, 2008R2, 2012, 2014 or higher.
0 Comments   1879 Views
Here Mudassar Ahmed Khan has explained with an example, how to pass Table name as Parameter (Variable) to sp_executesql command in SQL Server.
The sp_executesql command supports accepting Table name as Parameter (Variable) in the following SQL Server versions i.e. 2000, 2005, 2008, 2008R2, 2012, 2014 or higher.
Here Mudassar Ahmed Khan has explained with an example, how to dynamically change SelectCommand of SqlDataSource at runtime in ASP.Net using C# and VB.Net.
In order to change the SelectCommand of SqlDataSource at runtime, the SqlDataSource needs to be accessed programmatically from code behind in ASP.Net.
0 Comments   8117 Views
Here Mudassar Ahmed Khan has explained with an example, how to dynamically create and download CSV file in ASP.Net using C# and VB.Net.
0 Comments   7383 Views
Here Mudassar Ahmed Khan has explained with an example, how to bind / fill / populate data to ListBox control from database records in ASP.Net using C# and VB.Net.
The data will be populated from database table using DataReader.
0 Comments   3304 Views
Here Mudassar Ahmed Khan has explained with an example, how to populate ASP.Net ListBox control using SqlDataReader (DataReader) in C# and VB.Net.
Here Mudassar Ahmed Khan has explained with an example, how to use LIKE operator (statement) in Stored Procedures with SQL Server database.
In Stored Procedures, the LIKE operator (statement) is used with the Stored Procedure parameters.
Here Mudassar Ahmed Khan has provided a tutorial with simple example that explains how to use Cursor in SQL Server Stored Procedures. Cursor is supported in all SQL Server versions i.e. 2000, 2005, 2008, 2008R2, 2012 and 2014.
0 Comments   3777 Views
Here Mudassar Ahmed Khan explained with an example, how to use Comma Separated (Delimited) string values with IN and WHERE clause in SQL Server.
This article is applicable to all SQL Server versions i.e. 2005, 2008, 2012 and 2014.
1 Comments   6964 Views
Here Mudassar Ahmed Khan has explained with an example, how to use the SQL Server COALESCE function to select column values in Table as comma separated (delimited) string in SQL Server.
COALESCE function can be used to get comma separated (delimited) values from Table in the following SQL Server versions i.e. 2005, 2008, 2008R2, 2012 and 2014.
Here Mudassar Ahmed Khan has explained with an example, how to return result value of EXEC function and save it to a variable in SQL Server.
The EXEC function supports returning value to a variable is supported in SQL Server versions i.e. 2000, 2005, 2008, 2008R2, 2012, 2014 or higher.
Here Mudassar Ahmed Khan has explained with an example, how to execute a Stored Procedure that Returns value and assign its returned value to a variable in SQL Server.
Using the EXEC function returning value of a Stored Procedure to a variable is supported in all SQL Server versions i.e. 2000, 2005, 2008, 2008R2, 2012, 2014 or higher.
Here Mudassar Ahmed Khan has explained with an example, how to return value True if record exists and value False when record does not exist from Stored Procedure in SQL Server.
In order to return value the EXEC function will be used. The value will be returned as 1 (True) if record exists and 0 (False) is record does not exists.
Using the EXEC function returning value of a Stored Procedure to a variable is supported in all SQL Server versions i.e. 2000, 2005, 2008, 2008R2, 2012, 2014 or higher.
Here Mudassar Ahmed Khan has explained with example how to perform select, insert, edit, update, delete in Repeater control in ASP.Net using C# and VB.Net.
This process is also known as CRUD i.e. Create, Read, Update and Delete in Repeater control with SQL Server database backend in ASP.Net.
Here Mudassar Ahmed Khan has explained with an example, how to dynamically change (modify) Connection String of SqlDataSource control in Code Behind in ASP.Net using C# and VB.Net.
In order to dynamically change (modify) Connection String of SqlDataSource control in ASP.Net, the SqlDataSource has to be dynamically added in Code Behind.
Here Mudassar Ahmed Khan has provided a simple Cursor tutorial with Syntax example in SQL Server.
Cursor is supported in all SQL Server versions i.e. 2000, 2005, 2008, 2008R2, 2012 and 2014.