C# QA - Part Five

Q. If I want to connect to a data source other than Jet, how do I know what connection string to use?

A. Not only is different connection information available for different types of data sources but also for different versions of different

data sources. The best way of determining the connection string is to consult the documentation for the data source to which you

want to attach.

Q. What if I don't know where the database will be at runtime?

A. For file-based data sources such as Jet, you can add an Open File Dialog control to the form and let the user browse and select

the database. Then concatenate the filename with the rest of the connection information (such as the provider string).

Q. What are some applications that support automation?

A. All the Microsoft Office products, as well as Microsoft Visio, support automation. You can create a robust application by

building a client that uses multiple automation servers. For example, you could calculate data in Excel and then format and print the

data in Word.

Q. Is it possible to create an Automation server so that my application can be controlled by others?

A. Yes, it is possible to create .NET components that can be used by other applications. If this interests you, I suggest you seek out

an advanced text on the subject.

Q. How can I create the great installation wizards I see other install applications use?

A. If you want to create robust installations that gather user input in wizards, make changes to the Registry, allow you to include

additional files, create shortcuts, and so on, you need to use a tool that uses the Windows Installer technology.

Q. Should I assume that a user will always have the .NET Framework on her computer?

A. Generally, no. When distributing updates to your project, it's probably a safe bet that the user has installed the .NET Framework.

For an initial installation, you should specify the .NET Framework as a prerequisite (note that this is set by default).

No comments: