By Steffi28 ·
Hiya Im a bit stuck hope someone can help me.

Im working with SharePoint 2007, and SharePoint Designer. I have added an SQL database as a datasource and added an edit function basically what I want to do is when the user presses edit instead of it coming up as a text box where they can enter whatever they want I wnat it to be a drop down box.

So far I have this

<td class="ms-vb">

<asp:DropDownList runat="server" id="ff2{$Pos}" </td>

Now I know how to manually insert items by using asp:listitem and this is ok when there is only 2 or 3 choices but when selecting from the database there could be anything upto 20 choices so basically what I want to do is take the choices directly from the SQL database.

Can anyone help me on how to do this?

Thanks :)

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -


by Steffi28 In reply to asp:DropDownList

OK I found how to do it. This is what I got

<asp:DropDownList runat="server" id="ff2{$Pos}" DataSourceID="SqlDataSource3" DataTextField="LINE_ID" DataValueField="LINE_ID">

but for some reason now when I change data it doesnt save it just goes back to what it was, any ideas?


Collapse -

SQL Server access?

by jaytrain40 In reply to HMMM

Sounds basic, but you're requesting ideas, and I'm not sure how you have the program set up, so I'm going to give the following:
The code executes freshly on any computer accessing the resource? If it does, and the computer does not use any previously accessed lists, when you make the changes to the database, have they been committed to the SQL Server for access from scripts? Knowing this, I might be able to give you more information.

Collapse -

Not Actually sure what you mean

by Steffi28 In reply to SQL Server access?

But when I edit using a text box there is no problem its only when I change it to a dropdown that it no longer saves so I think it cant be an access problem. I dont know if I've misunderstood your question but alot of this is new to me Im on my university placement year and I havent used a lot of the stuff Im using now. Sorry if I sound stupid but pretend your asking your grandmother the question and then i might understand it lol

Collapse -

Dropdownlist data source

by ptran In reply to asp:DropDownList

you may store the result that you get from the database to a dataset or data table or array and set the dropdown list datasource to it and bind it

Collapse -


by Steffi28 In reply to Dropdownlist data source

The datasource is set to the database, im not doing any query so there is no result to get thanks anyway :)

Related Discussions

Related Forums