One of the project I am worked, I had to enumerate SQL Server instances of the network for creating dynamic connection string. Here is a code snippet which will retrieve all the SQL Server instance in a network using C# and ADO.Net.
using System.Data;
using System.Data.Sql;
SqlDataSourceEnumerator sqlDataSourceEnumerator = SqlDataSourceEnumerator.Instance;
DataTable sqlServerInstances = sqlDataSourceEnumerator.GetDataSources();
The Data Table contains 4 columns, [...]
Normally DataRepeater doesn’t have a paging feature; and you can implement it using LINQ, if you are using .Net 3.5. Here is an implementation which is using SQL Server 2005 feature ROW_NUMBER(). You can get more information about ROW_NUMBER() from MSDN.
Stored Procedure – xsp_GetPersons
CREATE PROCEDURE xsp_GetPersons
@StartIndex INT, @Count INT
AS
BEGIN
DECLARE @EndIndex INT
SET @StartIndex = @StartIndex * [...]
If you want to display hierarchical data in a Treeview normally we are using recursion. I was looking for code which helps to avoid recursion using a Single query. But that code was using VB.Net and it was using a class called “Collection”, which is not available in C#. So I was looking for a [...]
Also filed in .Net, .Net 3.0 / 3.5, Visual Studio, Windows Forms
|
Tagged .Net, C#, C#.Net, Common Table Expressions, CTE, Recursive function, Treeview, Windows Forms
|
The forum I joined recently got lot of queries like How to Save Images in the Database, How to save files in SQL Server, How read files from Database etc. So I thought of writing a post regarding this. Even though I am part of a Web project, I am doing some Windows applications for [...]
Also filed in .Net, .Net 3.0 / 3.5, ASP.Net, Visual Studio, WPF, Windows Forms
|
Tagged .Net, ASP.Net, C#.Net, File to Database, IIS 7, SQL Server, Windows Forms
|
Few days back I wrote a Post about FileStream feature in SQL 2008.(Filestream in SQL Server 2008). In this post I am trying to write the how to manage or use the FileStream feature from .Net managed code.
For adding a File to FileStream enabled table, we are using a new Data Type, SqlFileStream, which comes [...]