Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Update multiple records from list box

New Here ,
May 03, 2007 May 03, 2007
The idea is to present a list box to allow for the selection of multiple records. The records' primary key field having been set up as the value parameter in the list box. Then use a single update statement to update all selected records with a common value.

I have tried to do this using code similar to:

UPDATE MyTable SET MyTable.MyColumn = 1 WHERE ( MyTable.MyKeyField IN ( @ListOfIntegers ) )

Where the parameter is configured thus:
<Parameter Name="@ListOfIntegers" Value='<%# ((Request.Form["MyListBox"]' Type="Int" />


The idea is that the multiple selection listbox will return a comma separated list, which should l work nicely with the WHERE [column] IN ( .. ) syntax.

Unfortunatley if more than one record is selected the Complier throws a type conversion error.

I want to do this using Dreamweaver and C# on .NET.


Any ideas how to proceed ?

TOPICS
Server side applications
409
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 03, 2007 May 03, 2007
This article may be helpful
http://www.drdev.net/article11.asp
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 07, 2007 May 07, 2007
LATEST
Are you wanting to update multiple records with the same information or
different information for each record?

--
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver

Valleybiz Internet Design
www.valleybiz.net

"lyleja" <webforumsuser@macromedia.com> wrote in message
news:f1cpe5$jj1$1@forums.macromedia.com...
> The idea is to present a list box to allow for the selection of multiple
> records. The records' primary key field having been set up as the value
> parameter in the list box. Then use a single update statement to update
> all
> selected records with a common value.
>
> I have tried to do this using code similar to:
>
> UPDATE MyTable SET MyTable.MyColumn = 1 WHERE ( MyTable.MyKeyField IN (
> @ListOfIntegers ) )
>
> Where the parameter is configured thus:
> <Parameter Name="@ListOfIntegers" Value='<%# ((Request.Form["MyListBox"]'
> Type="Int" />
>
>
> The idea is that the multiple selection listbox will return a comma
> separated
> list, which should l work nicely with the WHERE [column] IN ( .. ) syntax.
>
> Unfortunatley if more than one record is selected the Complier throws a
> type
> conversion error.
>
> I want to do this using Dreamweaver and C# on .NET.
>
>
> Any ideas how to proceed ?
>
>
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines