GetDate

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"
SuccessURL=' said:
<Parameters>
<Parameter Name="@Version" Value='<%# IIf((Request.Form("Version") <>
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>
<MM:DataSet
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"
</MM:DataSet>
<MM:DataSet
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"
</MM:DataSet>
<MM:DataSet
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"
</MM:DataSet>
<MM:pageBind runat="server" PostBackBind="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><asp:DropDownList ID="Version" runat="server" DataSource="<%#
lstVersions.DefaultView %>" DataTextField="version"
DataValueField="version"></asp:DropDownList></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><asp:DropDownList ID="BuildByID" runat="server" DataSource="<%#
lstBuildBy.DefaultView %>" DataTextField="UserName"
DataValueField="UserID"></asp:DropDownList></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><asp:DropDownList ID="IsReleased" runat="server" DataSource="<%#
lstSelection.DefaultView %>" DataTextField="Selection"
DataValueField="Selection"></asp:DropDownList></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">&nbsp;</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>&nbsp;</p>
</body>
</html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top