繁体中文
设为首页
加入收藏
当前位置:.Net技术首页 >> 评论及其它 >> Building a Robust Web Based Email Client (WebMail) Using the IP*Works! ADO.NET Data Provider(原文)

Building a Robust Web Based Email Client (WebMail) Using the IP*Works! ADO.NET Data Provider(原文)

2005-01-09 20:59:52  作者:jfbao  来源:互联网  浏览次数:3  文字大小:【】【】【
简介: Building a Robust Web Based Email Client (WebMail) Using the IP*Works! ADO.NET Data Provider By Lance Robinson - Technical Evangelist, /n software. In the fall of 2004, /n software introduced ...

Building a Robust Web Based Email Client (WebMail) Using the IP*Works! ADO.NET Data Provider

By Lance Robinson - Technical Evangelist, /n software.

In the fall of 2004, /n software introduced a first in the world of Internet development: Internet ADO.Net Providers. Some of the most commonly used objects from the popular IP*Works! toolkit were included a new product called IP*Works! ADO.Net Provider, which allows you to work with these protocols in a way that database developers are more familiar. To get all of the mail from your Inbox, you can SELECT * from INBOX. To read the latest RSS feed you can SELECT * from feed. To send an email, just insert a new row into the OUTBOX table. In this article, I will talk about the features and use of the Provider, and along the way I'll create an IMAP and POP capable Webmail interface with a minimal amount of code. You can also download the full sample project here.

Overview Of The Provider

In the beginning, the protocols available are IMAP, POP, SMTP, NNTP, and RSS. Others will be added, like WebDAV (aka HTTPMail), LDAP, and more. IP*Works! ADO.Net Data Provider makes integration of Internet capabilities into applications quick and easy - without the need to become familiar with the inner-workings of the protocols themselves.

You are familiar with the DbConnection, DbDataAdapter, and DbCommand objects. Now let me introduce the IPWorksConnection, IPWorksDataAdapter, and IPWorksCommand objects. They work in the same familiar way, except with something a little bit different happening on the inside - updating from a server instead of a database. Here is a brief description of the different objects in the Provider. Later in this article I'll get into more specifics and show how to use each one.

IPWorksConnection

The IPWorksConnection object manages a connection to some server, whether it be an IMAP, POP, HTTP, SMTP, or NNTP server. The IPWorksConnection can be opened and closed explicitly, or the connection can be managed automatically (opened only when necessary) by the IPWorksDataAdapter.

IPWorksDataAdapter

The IPWorksDataAdapter is just like the DataAdapter you're used to. It will allow you to execute commands to populate a DataSet or DataTable. If a connection is not open, one will be created automatically in order to perform the necessary operation.

IPWorksCommand

The IPWorksCommand object represents a SQL command: SELECT, INSERT, DELETE, or UPDATE.

IPWorksCommandBuilder

The IPWorksCommandBuilder object will automatically generate INSERT, DELETE, and UPDATE commands for an IPWorksDataAdapter, given a defined SELECT command.

Connection

To get started, first I'll setup an IPWorksConnection, so I need to determine the connection string. To form the connection string, simply specify all of the properties of the connection as semi-colon separated values. One connection property is required in all instances of IPWorksConnection: protocol. The protocol connection property specifies the Internet protocol to use for this connection. Depending on the protocol, other connection properties will apply. For example, if I use the IMAP protocol, I'll need to specify mailserver, user, and password properties in order to connect. If I use the RSS protocol, I'll need a URL at least. Here are a few examples:

ipWorksConnection ipwConnection1 = new

责任编辑:admin
相关文章