Ask a Question related to Dreamweaver AppDev, Design and Development.
-
payado #1
Multiple Insert or Looping Insert
I built an application on an Access DB that allows a dispatcher to log trucks
in the field at their location as they call in. There are three backend
tables, Codes (for calling in on the radio), Trucks (for each unique truck),
and Events to log the truck at location with a code. The problem I am having
is I would like to use a CheckBoxList for the dynamically generated truck list.
That would allow the dispatcher to log more than one record with one
submission.
Does anyone know an easy way to insert a record for each truck selected in the
checkboxlist? It will use the same data from codes and whatever is entered for
location upon submission. I cannot use a stored procedure because of Access.
Can I loop the insert that Dreamweaver creates? Does anyone know a better way
to do multiple inserts into a table using a checkboxlist?
Following is what Dreaweaver has generated for the Insert:
<MM:Insert
runat="server"
CommandText='<%# "INSERT INTO tblEvents (TruckID, CodeID, Location, Notes)
VALUES (?, ?, ?, ?)" %>'
ConnectionString='<%#
System.Configuration.ConfigurationSettings.AppSett ings("MM_CONNECTION_STRING_con
nRadioLogASP") %>'
DatabaseType='<%#
System.Configuration.ConfigurationSettings.AppSett ings("MM_CONNECTION_DATABASETY
PE_connRadioLogASP") %>'
Expression='<%# Request.Form("MM_insert") = "form1" %>'
CreateDataSet="false"
SuccessURL='<%# "index.aspx" %>'
Debug="true"<Parameters>>
<Parameter Name="@TruckID" Value='<%# IIf((Request.Form("TruckID") <>
Nothing), Request.Form("TruckID"), "") %>' Type="WChar" />
<Parameter Name="@CodeID" Value='<%# IIf((Request.Form("CodeID") <>
Nothing), Request.Form("CodeID"), "") %>' Type="Integer" />
<Parameter Name="@Location" Value='<%# IIf((Request.Form("Location") <>
Nothing), Request.Form("Location"), "") %>' Type="WChar" />
<Parameter Name="@Notes" Value='<%# IIf((Request.Form("Notes") <>
Nothing), Request.Form("Notes"), "") %>' Type="WChar" />
</Parameters>
</MM:Insert>
payado Guest
-
What's faster - loop for insert or insert...select.
What is faster if I'm moving large numbers of records (anywhere from 10,000 to 300,000 records per archive) from one query to another table? 1)... -
insert multiple row
How do i insert multiple rows in database. for example: I have 3 list: list1: a1,a2,a3,a4 list2: b1,b2,b3,b4 list3: c1,c2,c3,c4 I want to... -
Multiple DB Insert
I have an XML file that has roughly 55,000 records. I need to parse the contents of the file and store it in a database. The problem I'm having is... -
Insert while looping
I'm running a query from a text file to return data that I will then use to insert into SQL - could someone give an example as to how to insert... -
INSERT statement contains fewer items than the insert list
The block of code below shows how I am inserting field values into my dbase table: strSQLStatement = "INSERT INTO tblArticles... -
Paul Whitham TMM #2
Re: Multiple Insert or Looping Insert
There are some tutorials on [url]www.charon.co.uk[/url] that show how to code multiple
inserts but they are ASP based. You could adapt the code for ASP.Net but it
would mean not using the MM:Insert tag.
--
Regards
Paul Whitham
Macromedia Certified Professional for Dreamweaver MX2004
Valleybiz Internet Design
[url]www.valleybiz.net[/url]
Team Macromedia Volunteer for Ultradev/Dreamweaver MX
[url]www.macromedia.com/support/forums/team_macromedia[/url]
"payado" <webforumsuser@macromedia.com> wrote in message
news:d7072v$44q$1@forums.macromedia.com...trucks> I built an application on an Access DB that allows a dispatcher to logtruck),> in the field at their location as they call in. There are three backend
> tables, Codes (for calling in on the radio), Trucks (for each uniquehaving> and Events to log the truck at location with a code. The problem I amlist.> is I would like to use a CheckBoxList for the dynamically generated truckin the> That would allow the dispatcher to log more than one record with one
> submission.
>
> Does anyone know an easy way to insert a record for each truck selectedentered for> checkboxlist? It will use the same data from codes and whatever isAccess.> location upon submission. I cannot use a stored procedure because ofway> Can I loop the insert that Dreamweaver creates? Does anyone know a betterNotes)> to do multiple inserts into a table using a checkboxlist?
>
> Following is what Dreaweaver has generated for the Insert:
>
>
> <MM:Insert
> runat="server"
> CommandText='<%# "INSERT INTO tblEvents (TruckID, CodeID, Location,System.Configuration.ConfigurationSettings.AppSett ings("MM_CONNECTION_STRING> VALUES (?, ?, ?, ?)" %>'
> ConnectionString='<%#
>
_conSystem.Configuration.ConfigurationSettings.AppSett ings("MM_CONNECTION_DATABA> nRadioLogASP") %>'
> DatabaseType='<%#
>
SETY<>> PE_connRadioLogASP") %>'
> Expression='<%# Request.Form("MM_insert") = "form1" %>'
> CreateDataSet="false"
> SuccessURL='<%# "index.aspx" %>'
> Debug="true"> <Parameters>> >
> <Parameter Name="@TruckID" Value='<%# IIf((Request.Form("TruckID") <>
> Nothing), Request.Form("TruckID"), "") %>' Type="WChar" />
> <Parameter Name="@CodeID" Value='<%# IIf((Request.Form("CodeID") <>
> Nothing), Request.Form("CodeID"), "") %>' Type="Integer" />
> <Parameter Name="@Location" Value='<%# IIf((Request.Form("Location")> Nothing), Request.Form("Location"), "") %>' Type="WChar" />
> <Parameter Name="@Notes" Value='<%# IIf((Request.Form("Notes") <>
> Nothing), Request.Form("Notes"), "") %>' Type="WChar" />
> </Parameters>
> </MM:Insert>
>
Paul Whitham TMM Guest



Reply With Quote

