首页 > 开发 > 综合 > 正文

Creating and displaying a DataSet in Dreamweaver M

2024-07-21 02:22:07
字体:
来源:转载
供稿:网友

creating and displaying a .net dataset


the new .net server model in dreamweaver mx lets you leverage the power of the .net framework in a visual environment.  anyone that is familiar with ultradev's recordset server behavior will feel very comfortable moving to .net's dataset.  even if you have never worked with dreamweaver, this tutorial will show you how easy it is.
first off, we need to create a connection to the database.  this is done in the databases tab in the files panel.  you can choose between two different types of connections
  • oledb connection
  • sql server connection

odbc, although somewhat supported in the .net framework as a separate download, was left out of this release.  this is probably a good thing because almost every major database has oledb drivers on the windows platform.  odbc is not as fast as oledb, which is probably why microsoft chose to "barely" support it as a separate download.  if you are using sql server as your database, then the sql server connection is the only way to go as it offers performance advantages.
we will be creating a sql server connection in this tutorial because that is what i am working with.  the oledb connection is not much different other than the fact that you can bring up the microsoft data link dialog.
  1. click the +icon in the databases panel
  2. choose sql server connection
  3. fill out the information for your database in the provided template

once you are done, you will see a tree view of your database that lets you explore tables, views, and stored procedures.
the next step is to apply the dataset server behavior.
  1. click the + icon in the server behaviors panel
  2. choose dataset
  3. name your dataset
  4. choose your connection
  5. choose the table and fields you want to retrieve

this is the exact same interface as the asp server model so as i mentioned before, transitioning to .net development will be easy if you come from an asp background.
after you have created the dataset, you will find that the contents of the datset are displayed in the bindings panel. you can drag each field over to the page you are working in, and place it wherever it needs to go in your design.  once you have laid our your design, you can apply the repeat region server behavior.
  1. highlight the items you just placed on the page.
    make sure you take into consideration page breaks, whether that be as <br /> at the end, <p></p> around the selection, or within <tr></tr> tags.
  2. click the + icon in the server behaviors tab.
  3. choose repeat region

behind the scenes, dreamweaver actually places the contents of your selection within <asp:repeater> tags.  
it's as simple as that, once you do this a couple of times, it becomes second nature, so you can focus on building your applications, instead of remembering esoteric object properties.
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表