J
JACO WESELLS
Hi
I am new to ASP etc. I am creating a simple Form to insert records into my
SQL database.
I need to know how to add the getdate function for my DateBuild column.
Thanks in advance.
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1"
%>
<%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls"
Assembly="DreamweaverCtrls,version=1.0.0.0,publicKeyToken=836f606ede05d46a,culture=neutral"
%>
<MM:Insert
runat="server"
CommandText='<%# "INSERT INTO dbo.VersionHistory (Version, DateBuild,
Machine, BuildByID, Patch, FullRelease, IsReleased, Notes, TestNotes) VALUES
(@Version, @DateBuild, @Machine, @BuildByID, @Patch, @FullRelease,
@IsReleased, @Notes, @TestNotes)" %>'
ConnectionString='<%#
System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_QFMHouse")
%>'
DatabaseType='<%#
System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_QFMHouse")
%>'
Expression='<%# Request.Form("MM_insert") = "form1" %>'
CreateDataSet="false"
Nothing), Request.Form("Version"), "") %>' Type="VarChar" />
<Parameter Name="@DateBuild" Value='<%# IIf((Request.Form("DateBuild") <>
Nothing), Request.Form("DateBuild"), "") %>' Type="DateTime" />
<Parameter Name="@Machine" Value='<%# IIf((Request.Form("Machine") <>
Nothing), Request.Form("Machine"), "") %>' Type="NChar" />
<Parameter Name="@BuildByID" Value='<%# IIf((Request.Form("BuildByID") <>
Nothing), Request.Form("BuildByID"), "") %>' Type="Int" />
<Parameter Name="@Patch" Value='<%# IIf((Request.Form("Patch") <>
Nothing), Request.Form("Patch"), "") %>' Type="NChar" />
<Parameter Name="@FullRelease" Value='<%# IIf((Request.Form("FullRelease")
<> Nothing), Request.Form("FullRelease"), "") %>' Type="NChar" />
<Parameter Name="@IsReleased" Value='<%# IIf((Request.Form("IsReleased")
<> Nothing), Request.Form("IsReleased"), "") %>' Type="NChar" />
<Parameter Name="@Notes" Value='<%# IIf((Request.Form("Notes") <>
Nothing), Request.Form("Notes"), "") %>' Type="VarChar" />
<Parameter Name="@TestNotes" Value='<%# IIf((Request.Form("TestNotes") <>
Nothing), Request.Form("TestNotes"), "") %>' Type="VarChar" />
</Parameters>
</MM:Insert>
<MMataSet
id="lstVersions"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%#
System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_QFMHouse")
%>'
DatabaseType='<%#
System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_QFMHouse")
%>'
CommandText='<%# "SELECT dbo.Versions.version FROM dbo.Versions ORDER BY
dbo.Versions.versionid" %>'
Debug="true"
id="lstBuildBy"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%#
System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_QFMHouse")
%>'
DatabaseType='<%#
System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_QFMHouse")
%>'
CommandText='<%# "SELECT * FROM dbo.Users ORDER BY dbo.Users.UserName"
%>'
Debug="true"
id="lstSelection"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%#
System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_QFMHouse")
%>'
DatabaseType='<%#
System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_QFMHouse")
%>'
CommandText='<%# "SELECT dbo.Selection.Selection FROM dbo.Selection ORDER
BY dbo.Selection.ID" %>'
Debug="true"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<style type="text/css">
<!--
..style3 {font-size: x-small}
-->
</style>
</head>
<body>
<form method="post" name="form1" runat="server">
<table align="center">
<tr valign="baseline">
<td nowrap align="right">Version:</td>
<td><aspropDownList ID="Version" runat="server" DataSource="<%#
lstVersions.DefaultView %>" DataTextField="version"
DataValueField="version"></aspropDownList></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Date Build:</td>
<td><asp:TextBox ID="DateBuild" runat="server" /></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Machine:</td>
<td><asp:textbox id="Machine" TextMode="SingleLine" Columns="32"
runat="server" />
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Build By</td>
<td><aspropDownList ID="BuildByID" runat="server" DataSource="<%#
lstBuildBy.DefaultView %>" DataTextField="UserName"
DataValueField="UserID"></aspropDownList></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Patch:</td>
<td><asp:CheckBox ID="Patch" runat="server" Enabled="true" /></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Full Release:</td>
<td><asp:CheckBox ID="FullRelease" runat="server" Enabled="true"
/></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Released:</td>
<td><aspropDownList ID="IsReleased" runat="server" DataSource="<%#
lstSelection.DefaultView %>" DataTextField="Selection"
DataValueField="Selection"></aspropDownList></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Notes:</td>
<td><asp:textbox Columns="40" id="Notes" runat="server"
TextMode="MultiLine" Rows="5" />
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Test Notes:</td>
<td><asp:textbox id="TestNotes" TextMode="MultiLine" Columns="40"
runat="server" Rows="5" />
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right"> </td>
<td><input name="Submit" type="submit" value="Enter">
<input name="Reset" type="reset" value="Clear"></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1">
</form>
<p> </p>
</body>
</html>
I am new to ASP etc. I am creating a simple Form to insert records into my
SQL database.
I need to know how to add the getdate function for my DateBuild column.
Thanks in advance.
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1"
%>
<%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls"
Assembly="DreamweaverCtrls,version=1.0.0.0,publicKeyToken=836f606ede05d46a,culture=neutral"
%>
<MM:Insert
runat="server"
CommandText='<%# "INSERT INTO dbo.VersionHistory (Version, DateBuild,
Machine, BuildByID, Patch, FullRelease, IsReleased, Notes, TestNotes) VALUES
(@Version, @DateBuild, @Machine, @BuildByID, @Patch, @FullRelease,
@IsReleased, @Notes, @TestNotes)" %>'
ConnectionString='<%#
System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_QFMHouse")
%>'
DatabaseType='<%#
System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_QFMHouse")
%>'
Expression='<%# Request.Form("MM_insert") = "form1" %>'
CreateDataSet="false"
<Parameter Name="@Version" Value='<%# IIf((Request.Form("Version") <>SuccessURL=' said:<Parameters>
Nothing), Request.Form("Version"), "") %>' Type="VarChar" />
<Parameter Name="@DateBuild" Value='<%# IIf((Request.Form("DateBuild") <>
Nothing), Request.Form("DateBuild"), "") %>' Type="DateTime" />
<Parameter Name="@Machine" Value='<%# IIf((Request.Form("Machine") <>
Nothing), Request.Form("Machine"), "") %>' Type="NChar" />
<Parameter Name="@BuildByID" Value='<%# IIf((Request.Form("BuildByID") <>
Nothing), Request.Form("BuildByID"), "") %>' Type="Int" />
<Parameter Name="@Patch" Value='<%# IIf((Request.Form("Patch") <>
Nothing), Request.Form("Patch"), "") %>' Type="NChar" />
<Parameter Name="@FullRelease" Value='<%# IIf((Request.Form("FullRelease")
<> Nothing), Request.Form("FullRelease"), "") %>' Type="NChar" />
<Parameter Name="@IsReleased" Value='<%# IIf((Request.Form("IsReleased")
<> Nothing), Request.Form("IsReleased"), "") %>' Type="NChar" />
<Parameter Name="@Notes" Value='<%# IIf((Request.Form("Notes") <>
Nothing), Request.Form("Notes"), "") %>' Type="VarChar" />
<Parameter Name="@TestNotes" Value='<%# IIf((Request.Form("TestNotes") <>
Nothing), Request.Form("TestNotes"), "") %>' Type="VarChar" />
</Parameters>
</MM:Insert>
<MMataSet
id="lstVersions"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%#
System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_QFMHouse")
%>'
DatabaseType='<%#
System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_QFMHouse")
%>'
CommandText='<%# "SELECT dbo.Versions.version FROM dbo.Versions ORDER BY
dbo.Versions.versionid" %>'
Debug="true"
<MMataSet</MMataSet>
id="lstBuildBy"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%#
System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_QFMHouse")
%>'
DatabaseType='<%#
System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_QFMHouse")
%>'
CommandText='<%# "SELECT * FROM dbo.Users ORDER BY dbo.Users.UserName"
%>'
Debug="true"
<MMataSet</MMataSet>
id="lstSelection"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%#
System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_QFMHouse")
%>'
DatabaseType='<%#
System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_QFMHouse")
%>'
CommandText='<%# "SELECT dbo.Selection.Selection FROM dbo.Selection ORDER
BY dbo.Selection.ID" %>'
Debug="true"
<MMageBind runat="server" PostBackBind="true" /></MMataSet>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<style type="text/css">
<!--
..style3 {font-size: x-small}
-->
</style>
</head>
<body>
<form method="post" name="form1" runat="server">
<table align="center">
<tr valign="baseline">
<td nowrap align="right">Version:</td>
<td><aspropDownList ID="Version" runat="server" DataSource="<%#
lstVersions.DefaultView %>" DataTextField="version"
DataValueField="version"></aspropDownList></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Date Build:</td>
<td><asp:TextBox ID="DateBuild" runat="server" /></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Machine:</td>
<td><asp:textbox id="Machine" TextMode="SingleLine" Columns="32"
runat="server" />
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Build By</td>
<td><aspropDownList ID="BuildByID" runat="server" DataSource="<%#
lstBuildBy.DefaultView %>" DataTextField="UserName"
DataValueField="UserID"></aspropDownList></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Patch:</td>
<td><asp:CheckBox ID="Patch" runat="server" Enabled="true" /></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Full Release:</td>
<td><asp:CheckBox ID="FullRelease" runat="server" Enabled="true"
/></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Released:</td>
<td><aspropDownList ID="IsReleased" runat="server" DataSource="<%#
lstSelection.DefaultView %>" DataTextField="Selection"
DataValueField="Selection"></aspropDownList></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Notes:</td>
<td><asp:textbox Columns="40" id="Notes" runat="server"
TextMode="MultiLine" Rows="5" />
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Test Notes:</td>
<td><asp:textbox id="TestNotes" TextMode="MultiLine" Columns="40"
runat="server" Rows="5" />
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right"> </td>
<td><input name="Submit" type="submit" value="Enter">
<input name="Reset" type="reset" value="Clear"></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1">
</form>
<p> </p>
</body>
</html>