Databases Reference
In-Depth Information
6.
Run the project, and click the ODBC button. As in the previous example, the list box
populates with the names from the Person.Person table. The grid also populates with the
same set of names (see Figure 5-2 ).
Figure 5-2. Finished form with data
From these examples, you can see that connecting to and querying SQL Database is no different from connecting
to a local instance of SQL Server. The end of this chapter discusses some guidelines and best practices to help you
prepare for your move to SQL Database.
So far we have discussed connecting with ADO.NET and ODBC along with the different options we have with
each, so let's continue the discussion and talk about using the sqlcmd utility.
sqlcmd
If you've worked with SQL Server for any length of time, chances are you've worked with the sqlcmd utility. This utility
lets you enter and execute T-SQL statements and other objects via a command prompt. You can also use the sqlcmd
utility via the Query Editor in sqlcmd mode, in a Windows script file, or via a SQL Server Agent job.
This section discusses how to use the sqlcmd utility to connect to a SQL Database instance and execute queries
against that database. This section assumes that you have some familiarity with sqlcmd. This utility has many options,
or parameters, but this section only discusses those necessary to connect to SQL Database.
 
Search WWH ::




Custom Search