A Dreamweaver DMX Extension that creates ASP.Net code for a DataReader, DataSet, DataTable, Data Object and an ExecuteNonQuery e.g. Update, Insert and Delete. These extensions generate raw code and do not use a dll like the built-in Dreamweaver DataSet.
It comes with 4 simple examples showing how one might use these extensions (VB.Net and C#)
- DataReader with the datasource specified in the page load event
- DataReader with the datasource specified on the repeater control
- Filtering with two datareaders
- Nonquery showing an insert
Supports VB.Net and C# with these database connections
- SQLServer
- OleDb
- Odbc (Not tested)
Watch Demo | Buy Now $9.99 USD (245k Download)
Below is an actual C# code snip that was generated using the DataReader Generator.
<script runat="server">
// ASP.Net Datasource ~ DataReader
// By http://www.ottivacsdesign.com
// A Dreamweaver generated code block
public OleDbDataReader GetProducts(int WCategoryID)
{
OleDbConnection myConnection = new OleDbConnection(ConfigurationSettings.AppSettings["MM_CONNECTION_STRING_conn"]);
OleDbCommand myCommand = new OleDbCommand(); // create command
myCommand.Connection = myConnection; // assign connection to command
myConnection.Open(); // open the connection
myCommand.CommandText = "SELECT * FROM Products WHERE CategoryID = ? "; // the sql statement to execute
myCommand.Parameters.Add("@WCategoryID", OleDbType.Integer).Value = WCategoryID;
// run sql and then close the connection
OleDbDataReader myReader = myCommand.ExecuteReader(CommandBehavior.CloseConnection);
return myReader;
}
</script>
It is important to note these extensions are "code generators" so you will have to hook into this generated code manually. For example to tie the above snip of code to a asp:Repeater control you would have to specify that on the DataSource property.
<asp:Repeater DataSource='<%#GetProducts(Int32.Parse(Request.QueryString["ID"]))%> |