In order to retreive table schema programatically, we can use the GetSchemaTable method of the DataReader as follows: [sourcecode lang=’csharp’] using (OleDbConnection cn = new OleDbConnection()) { OleDbCommand cmd; DataTable schemaTable; OleDbDataReader reader; cn.ConnectionString = @”Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Northwind;Data Source=(local);”; cn.Open(); cmd = new OleDbCommand(“Employees”, cn); cmd.CommandType = CommandType.TableDirect; using (reader = cmd.ExecuteReader(CommandBehavior.SchemaOnly |… Read More

Perhaps the best kept secret (or at least the least discussed feature) of Visual Studio 2005 is the client-side reports. Client-side reports consists of the Report Viewer Control and it’s accompanying Report Designer that comes standard with Visual Studio 2005 Professional and up. This feature can be used to develop ASP.NET or WinForms solutions that… Read More

I recently designed an intranet application using ASP.NET 2.0 and really loved the membership and role providers that tremendously simplifified our implementation of security features in the application. Membership and role information can be stored in a SQL Server database or another repository such as Active Directory. For our intranet application it made sense to… Read More

I copied the VHD file of a virtual machine that had SQL Server 2000 installed on it. After running NEWSID from Sysinternals and giving my virtual machine a new name, I had to deal with the fact that SQL Server would not recognize my new machine name. Luckily I found this FAQ on Vyas’s web… Read More