.Net, ASP.NET, Data Sources, GridView, Programming, VB.NET, Web Development, WebForms

WebForms Declarative Data Binding using Eval & Bind

I have been using Visual Studio’s Declarative WebForms programming model lately to quickly create Web-based form interfaces. As part of this process I have been making extensive use of control binding using the Eval() and Bind() statements, and in some cases even the old ASP Response.Write syntax. As part of my review, I will use this article to to go over the pros and cons of using either option.

As a general rule of thumb, both Eval() and Bind() work similarly for read operations but Bind() offers more functionality when binding controls to a data source for the full spectrum of Read/Write operations.

Continue reading “WebForms Declarative Data Binding using Eval & Bind”

Advertisement
Data Sources, Programming, SQL, SQL Server 2005, SQL Server 2008, SQL Tips, tSQL

SQL Server: How to Ad-Hoc Query an Excel Spreadsheet using OpenRowset

Running an ad-hoc query from SQL Server SSMS to an Excel spreadsheet is amazingly straightforward using the OpenRowset command.

Here’s how it’s done…

For starters, copy the Excel spreadsheet to a location where the installed version of SQL Server can access it. This is necessary since your query in SSMS (SQL Server Management Studio) will not execute from your local machine. The query will be passed to SQL Server, which will then attempt to locate the spreadsheet as an OLE DB data source in order to run your query on it.

So make sure that the Excel spreadsheet is located either on the computer SQL Server is installed on, or on a network share which the SQL Server account has access to.

Step two is to open SSMS, connect to SQL Server, and open a query window in SSMS where you can run your query from.

Continue reading “SQL Server: How to Ad-Hoc Query an Excel Spreadsheet using OpenRowset”

Crystal Reports, Data Sources, Programming, Technology, UDL

UDL Files: How to Create and Configure Universal Data Link Files

UDL files can be incredibly useful for a variety of reasons (please see my earlier post for details). In this article I will explain the steps for creating and configuring a UDL file.

Creating a UDL file is quite straightforward. Here are the steps:

  1. First create a new text document in Windows Explorer and give a name to your new file, making sure you set the extension to .udl  (or you can open notepad and save it using .udl extension). Either way, make sure nothing is entered in the notepad document.
  2. Once you have created your new .udl file, the icon for your file should change from the icon for a text document to a special icon specific to .udl files
  3. Now double click your new .udl file in order to open it. Continue reading “UDL Files: How to Create and Configure Universal Data Link Files”