Joining Two Dropdown Lists To Create Third Dropdownlist

Oct 23, 2007

How do i add two values of Dropdownlist 1 and 2 to create No.3

Is there an easy way through Visual Studio to do this than Realms of code that i have been reading online,

 Surely, there is some command that is like Select Distinct Name from Clients WHERE city=@city + country=@country

 Or is it not this easy?

View 2 Replies


ADVERTISEMENT

Updating Grid View That Has Dropdown Lists

Jun 28, 2007

I have gridview bound with SqlDataSource control. One of the grid columns is a dropdown list which is populated programatically, (the gridview has template column with edittemplate field with dropdown list), dropdown Value contains of course collection of IDs.Please tell me how to declare UpdateCommand which will update the row with the dropdown list. The problem is with parameter regarding the column with dropdown list. When i declare this parameter and bind it to SelectedValue property of the dropdownlist from edittemplate tag - it doesnt work, because datasource control cannot see this dropdown list. So, how am i supposed to declare the ID of the row being updated in <updateParameters>? Thanks in advance!  

View 4 Replies View Related

Multiple Master Detail Dropdown Lists Sorting

Jan 29, 2007

I have multiple drop down lists that I would like to have send parameters to a stored procedure that does a select on the data.  (Kind of like a search feature)  But if a ddl isnt populated, I want that to act like a * and get all.  For instance, I have a persontype, state, and country drop down lists.  If I drop the state one down to WA, I want the gridview to populate with all the people in WA regardless or their type.  If I populate type and state, have it give me both regardless of country.
What does the stored procedure or select syntax look like for this?  (What would the default values of my dropdown boxes?)
my current sql select statement (The bottom 3 are bit fields which are throwing me off a bit too).  do i need to have some IsNull statments around each variable in the select?SELECT

PersonFirstName
, PersonLastName
, PersonStreetAddress
, PersonCity
, PersonZip
, PersonEmail
, PersonEmailDate
, PersonPhone1
, PersonNotes
, InterestChapterLeaders
, InterestMembers
, InterestUniLeader
, PersonGradYear
, PersonTypeID
, CountryID
, StateID
, SchoolID
, PersonID

FROM tblPerson

WHERE

tblPerson.PersonTypeID = @PersonTypeID
and tblPerson.StateID = @StateID
and tblPerson.CountryID = @CountryID
and tblPerson.SchoolID = @SchoolID
and tblPerson.InterestChapterLeaders = @InterestChapterLeaders
and tblPerson.InterestMembers = @InterestMembers
and tblPerson.InterestUniLeader = @InterestUniLeader 

View 8 Replies View Related

How To Create Store Procedure To Use With Dropdownlist

Apr 29, 2008

Dear all,
i want to create a storeprocedure that may acept value such as  0,1, 1a, 2, 2a etc.. from a dropDownList. But i always get an error. below is sample of my SQL1 DECLARE @val varchar(5)
2 DECLARE @sql varchar(4000)
3
4 SET @val = '1a'
5 SET @sql = 'select * FROM [dbo].[vwFormNAllAnswers]'
6
7 IF @val NOT LIKE '0'
8 SET @sql = @sql + 'WHERE QuestionCode LIKE '+ @val
9
10 EXEC(@sql)
 

View 3 Replies View Related

Create Output Which Just Reflects Latest Conditions When Joining Back To Contract

Oct 10, 2013

col 1 is the pk for this table called Conditions - this table is related to contract.

Col 1 - PKContract TypeType ID
973300 711917 C30
973301 711917 C32
973302 711917 C31
1152323 711917 C30
1152324 711917 C31
1152325 711917 C32

A contract can many conditions so 1:M...Col 2 is the contract reference and the linking join to contract

Now - a condition related to an contract can have many re-trys and the causes the pk to increment. As you can see there are three conditions related to first attempt and then another three conditions.I want to create an ouput which just reflects the latest conditions when joining back to contract - Is this possible?I have requested to application providers to provide flag, but this will take some time...

View 8 Replies View Related

Drop Down Lists

May 27, 2004

I'm want to be able to choose(including multiple selections) names from a drop down list that are fetched from the database(from table "Employees") and add them to table "Biotechnology".

Employees(ID,FirstName,LastName)
Biotechnology(ID,EmployeeID)

**assuming that EmployeeID in "Biotechnology" is the ID from "Employees" table

Example: We add Employees.ID(23, 33) to Biotechnology.EmployeeID

would be

Biotechnology:
[ID] [EmployeeID]
01 - 23
02 - 33

View 1 Replies View Related

Mailing Lists

Jul 20, 2005

Hi AllWe are running SQL Server & Outlook with an exchange server. We arelooking for a way to import the address book & email details into adatabase table.We have managed to do this with MS Access by using the import optionexchange(). Is there a similar way this can be done in SQLServer 2000

View 2 Replies View Related

Working With Lists

Aug 16, 2007

I'm new to SQL. I don't understand yet how to add if statements and other scripting techniques. But this is what I am trying to do...

I have a list of IDs (1, 2, 3, 4, 5, 6, 7, 8). I want to query a table and then display which of those IDs are NOT in that table. It seems like it should be easy, but I don't know how to do it.

Any help would be much appreciated.

thanks

scott

View 1 Replies View Related

T_SQL, Lists And Arrays

Dec 30, 1999

I want to pass my stored proc a list, and either loop through it as a list or (better) turn it into an array and loop through it that way to insert it. Psuedocode would be...

Loop from 0 to ListLength
begin
INSERT Transaction_Data
end

Thanks from an SQLS7 newbie,

jE

View 4 Replies View Related

SP That Lists The Servers Online

May 3, 2001

Does anyone know which SP to use to get the list of available servers?
I want to call it from a VB app via ADO to provide the user with a choice of servers available.

View 1 Replies View Related

Arrays And Lists In SQL 2005

Mar 4, 2007

I am glad to announce that there is now a version of my article "Arrays andLists in SQL Server" for SQL 2005 available on my web site.THe URL for the article ishttp://www.sommarskog.se/arrays-in-sql-2005.html. If you are curious aboutthe performance numbers they are in an appendix athttp://www.sommarskog.se/arrays-in-sql-perftest.html.The old version of the aritlce remains, as the new article covers SQL 2005only. The old version is now athttp://www.sommarskog.se/arrays-in-sql-2000.html.The old URL, http://www.sommarskog.se/arrays-in-sql.html leads to a pagethat links to both articles.And the reason that there are two articles is simply that SQL 2005 addsso many new features: nvarchar(MAX), the CLR, the xml data type, CTE thatall can be used in the realm of arrays and lists.--Erland Sommarskog, SQL Server MVP, Join Bytes!Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/pr...oads/books.mspxBooks Online for SQL Server 2000 athttp://www.microsoft.com/sql/prodin...ions/books.mspx

View 1 Replies View Related

Variable Arg Lists To PreparedStatements

Jul 20, 2005

Is there a way to use PreparedStatements (or bind variables) with SQLstatements that have a variable number of arguments. For example, Ihave an array of IDs for employees of a certain type and I want tohave a PreparedStatement retrieve all of them in a single SQL call.SELECT FROM employees WHERE employee_type = ? employee_id in(?,?,?,...,?)It seems at least in Java that PreparedStatements can only take afixed number of arguments?PreparedStatement pstmt = con.prepareStatement("SELECT FROMemployees WHERE employee_type = ? AND employee_id = ?");pstmt.setLong(1, employeeType);pstmt.setInt(2, employeeID);Is there a way to have a PreparedStatement for a SQL "IN" clause orsimilar variable argument length clauses? I heard that Temp tables isone option where you first insert your array of IDs into a Temp tableand then use a JOIN. But that seems to defeat the purpose as itrequires multiple queries. Is there anyway to something like this:int[] employeeIDArray = getEmployees();PreparedStatement pstmt = con.prepareStatement("SELECT FROMemployees WHERE employee_type = ? AND employee_id IN (?)");pstmt.setLong(1, employeeType);pstmt.setIntArray(2, employeeIDArray); <--- How can I do this?Thanks,- Robert

View 7 Replies View Related

Getting Data From Sharepoint Lists

May 15, 2006

Hi,

I'm trying to get data from WSS lists by web services. I think there are two ways:

- using SSIS standard components (Web Service Task) and
- creating a custom source adapter.

My problem with the Web Service Task is, that the WSS method GetListItems has some non-standard parameters (see part from wsdl-file below). Thus, after selecting the method in the editor an clicking on "Ok", I get the error message "The selected Web method contains unsupported arguments". I think the problem is the missing type-attribute.

<s:element name="GetListItems">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="listName" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="viewName" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="query">
<s:complexType mixed="true">
<s:sequence>
<s:any />
</s:sequence>
</s:complexType>
</s:element>
...

My question: Is there a way to extend the Task to handle such parameters?

View 1 Replies View Related

SSIS &&amp; SharePoint Lists

Apr 7, 2006

Hi,



is there any example how to extract values from a SharePoint list? I searched in Google but I only found something about that someone failed using the web service task for it... If possible I would like to get around any custom .net code (Scripts would be OK), but if I can't get around that, I have to follow that path...

Thanks,



View 5 Replies View Related

No _vti_bin Or Lists.asmx

Apr 28, 2008

I am desperate to retrieve lists from SharePoint using Reporting Services to consolidate with other data


I got stopped before I ever started. Defined a data source using the following syntax....but then I search for vti_bin or lista.asmx if find none.

http://<server>/<path>/_vti_bin/lists.asmx.

sharepoint/SQL 2005 running in intergated mode on single machine for proof of concept.

after formulating the dataset query I receive an error that
the XmlDP query is invalid.(Microsoft.ReportingServices.DataExtensions)

Any ideas how I screwed things up?

.

View 2 Replies View Related

DbDataReader.NextResult With Generic Lists ?

Jun 20, 2006

 Hey I'm using this DAL to populate a generic list called assetDetailListHowever I'm adding a 2nd result set to my stored proc, protected void GenerateAssetDetails<T>(DbDataReader dataReader, ref List<AssetDetails> assetDetailList)        {            while (dataReader.Read())            {                    // Create a new culture                    AssetDetails assetDetail = new AssetDetails();                    // Set the culture properties                                       assetDetail.FileName = dataReader.GetString(dataReader.GetOrdinal("filename"));                    assetDetail.Title = dataReader.GetString(dataReader.GetOrdinal("title"));                    assetDetail.AltTag = dataReader.GetString(dataReader.GetOrdinal("alt_tag"));                    assetDetailList.Add(assetDetail);                    dataReader.NextResult();// this is the 2nd result set               AssetContent assetContent = new AssetContent();               assetContent.content_id = dataReader.GetInt32(dataReader.GetOrdinal("content_id"));             how do I creatre another  list .Add(assetContent);            }            // Close and dispose of the reader            dataReader.Close();            dataReader.Dispose();        }        #endregion    }

View 2 Replies View Related

Any Tips For Using Large Parameter Lists

Mar 8, 2007

Our parts table has 5k records. I want to use part number as a parameter for one of my reports. Is there a way to do this and have the report generate in a reasonable amount of time?

Thanks

View 3 Replies View Related

Horizontal Display For Tables Or Lists?

Jul 5, 2007

I would like to display a couple of records horizontally via a table or list, but don't think this is possible. Am I right? The given recordset should only have two records and the formatting would be much better if they were displayed left to right rather than one on top of the other. Is this just not possible with SSRS? Thanks,

Levi

View 2 Replies View Related

Aggregate Data Grouped Lists

Apr 15, 2008

Hello,

I`ve created a table in a list that is grouped by years. Result is a Report, that consists of several years (List grouped by years, each containing the table with the data of the year).

Now I want to aggregate some numbers of the table on each page (year) of the list.

The sum()-function - doesn't matter which scpoe I use - always aggregates only the values of the actual list (Year), not considering the years before.

Can anyone help?

Thanks a lot -

Markus

View 2 Replies View Related

Management Studio Lists All Databases

Oct 18, 2005

I was under the impression that Management Studio wouldn't list any databases that a user doesn't have access to.  But if I create a new user and give them db_owner permissions to just one database, if they log into Management Studio, they are able to see all databases listed.  They don't have access to do anything further, but they can still see the list which I thought was handled better in 2005.

View 8 Replies View Related

Lists: Can't Get A Header To Appear For Each Page Of My List

Apr 16, 2008



I want to display a phone directory by department.

I created a list and told it to group on department and then I put a table in the list that had PhoneNo, EmployeeName as the columns.

Now the list works in that it seperates that table out by department (so 5 departments means 5 instances of the table with a text box above the table but inside the list with DepartmentName.Value).

The problem though is that text box only appears once for each table, the first time the table is generated. I can't get the department name to display at the start of each page.

Do I need another sublist or something, how can I get the department name textbox to appear at the start of each page for my list?

So what I have is:
DEPARTMENT NAME: Sales
---(table starts here)
.............5555...Smith
.............lots more names.......
- - - - - - - - - - - - - - - PAGE BREAK - - - - - - - - - -
---(table continues on from last page...)
.............4444...Johnson
.............3246...Benson
---(table ends here)
------------------------------------new iteration of this, so the next department is IT and this all repeats again

What I want to get is:

DEPARTMENT NAME: Sales
---(table starts here)
.............5555...Smith
.............lots more names.......
- - - - - - - - - - - - - - - PAGE BREAK - - - - - - - - - -
DEPARTMENT NAME: Sales (this is repeated as it is the start of a new page, in a perfect world I'd be able to even say "Continued..." after the department name on all pages that were not the first page it appeared)
---(table continues on from last page...)
.............4444...Johnson
.............3246...Benson
---(table ends here)
------------------------------------new iteration of this, so the next department is IT and this all repeats again with department name at the start of each and every page

View 1 Replies View Related

Headers On New Pages Using Lists And Subreports

Sep 22, 2005

I have a large report which profiles a customer and produces many pages consisting of sales records, support calls and emails, etc etc.

View 3 Replies View Related

WSS 3.0 Lists Data Processing Extension

Mar 12, 2007

Hello,



I'm writing a Data Processing Extension for SSRS 2005 that allows you to use a WSS 3.0 List as a dataset.
This works for one list per dataset. Now I am trying to extend the extension to allow multiple lists in a dataset because I want to join lists on a common field (INNER JOIN). The problem is that I can only return one DataTable to the Report Server with the DataReader. Does anyone know if it is possible to return multiple DataTables (without the join)?

I'm a student, working on this project. I know Visual Basic.net but only started last month with Data.

Thanks in advance

Tom

View 2 Replies View Related

Gridview And DropDownList

Oct 18, 2006

Hello:I have add a DropDownList to my GridView and binded the dropdownlist to a field from a select statement in the SQLDataSource. I have EnabledEditing for my GridView. The GridView is populated with information from the select statement. Some of the information returned from the select statement is null. The field where the dropdownlist is binded it is null in some cases and does not have a value that is in the dropdownlist so I get and error when I attempt to do an update. 'DropDownList1' has a SelectedValue which is invalid because it does not exist in the list of items.Parameter name: value Is there a way to get around this besides initializing all the columns in the table that are going to be binded to a dropdownlist to a value in the dropdownlist?

View 1 Replies View Related

Sqldatasource And Dropdownlist

Nov 8, 2006

 
Hi,
I have sqldatasource that i set up in VS2005.  i have a dropdownlist using this source.  Data is added to the db from a different app and i want this dropdownlist to use the latest data on a page refresh. 
However i can not refresh the sqldatasource - the dropdownlist does not show the latest additions to the db - i  hae to rebuild to see them.  i tried turnning 'enable caching' and 'enable viewstate' to false but no luck.
How is this done.
 
Thanks.
 
 

View 1 Replies View Related

Can You Use Substring In ASP.NET On A DropDownList ?

Oct 26, 2007

I'm using the GridView to display some accounting infromation. I have a project where I have a 14 character control number. I would like to have a dropdown list to select the account classification of records to be displayed. The accounting classification is the first two characters of the control number.  So the dropdown list needs to show unique first two characters and the GridView will be filtered on these two characters.  I have been trying to use "substring" in the ASP.NET code; not even sure you can.
Any suggestions on how to accomplish this would be greatly appreciated.  See code below:
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource2"
DataTextField="control_num" DataValueField="control_num">
</asp:DropDownList><asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:GPCRReportsConnectionString %>"
SelectCommand="SELECT DISTINCT [substring(control_num,1,2)] FROM [Request]"></asp:SqlDataSource>
ERROR: Invalid column name 'substring(control_num,1,2)'.

View 6 Replies View Related

Not Inserting Dropdownlist

Jan 30, 2008

Hi folks,
I'm in trouble getting an dropdownlist inserting its selected value into an .mdb
I'll insert my datasource code. There is another dropdownlist in this formview working good.
There is a datafield ID_Org_Einheit in the database to gather the value.
Could you please look this over?
Many thanks
Rosi
 
 
This is the dropdownlist
<asp:DropDownList ID="DDL_Org_alle" runat="server" DataSourceID="SDS_Org_alle" DataTextField="OE_gegliedert"
DataValueField="ID_org">
</asp:DropDownList>
and the datasource
<asp:SqlDataSource ID="SDS_insert_FB_log" runat="server" ConnectionString="<%$ ConnectionStrings:FahrtenbuchConnectionString %>"
 
InsertCommand="INSERT INTO tab_Fahrtenbuch_log([Datum_Eintragung], [Fahrer], [ID_Org_Einheit], [pol_Kennzeichen], [ID_Einsatzzweck], [Strecke_von], [Strecke_bis], [Zeit_von], [Zeit_bis], [km_von], [km_bis]) VALUES (@Datum_Eintragung,@Fahrer,@ID_Org_Einheit,@pol_Kennzeichen,@ID_Einsatzzweck,@Strecke_von,@Strecke_bis,@Zeit_von,@Zeit_bis,@km_von,@km_bis)" ProviderName="<%$ ConnectionStrings:FahrtenbuchConnectionString.ProviderName %>"
SelectCommand="SELECT Datum_Eintragung, Fahrer, ID_Einsatzzweck, Strecke_von, Strecke_bis, pol_Kennzeichen, ID_Org_Einheit, Zeit_von, Zeit_bis, Bemerkung, km_von, km_bis FROM tab_Fahrtenbuch_log">
<InsertParameters>
<asp:FormParameter FormField="Datum_EintragungTextBox" Name="Datum_Eintragung"/>
<asp:FormParameter FormField="FahrerEintragTextBox" Name="Fahrer"/>
<asp:FormParameter FormField="DDL_Org_alle" DefaultValue="1" Name="ID_Org_Einheit"/>
 
<asp:FormParameter FormField="polKennzTextBox" Name="pol_Kennzeichen"/>
<asp:FormParameter FormField="DDL_Einsatzzweck" DefaultValue="1" Name="ID_Einsatzzweck" Direction="Input" Size="3" /><asp:FormParameter FormField="StartTextBox" Name="Strecke_von"/> <asp:FormParameter FormField="ZielTextBox" Name="Strecke_bis"/>
 
<asp:FormParameter FormField="AbfahrtTextBox" Name="Zeit_von"/>
<asp:FormParameter FormField="AnkunftTextBox" Name="Zeit_bis"/><asp:FormParameter FormField="kmFahrtBeginnTextBox" Name="km_von"/> <asp:FormParameter FormField="kmFahrtEndeTextBox" Name="km_bis"/>
 
</InsertParameters></asp:SqlDataSource>
 

View 3 Replies View Related

My DropDownList Won't Declare?

Mar 3, 2008

 Need a little help! I am trying to insert ListItems values from a DropDownList into a database table. However in the code behind I am continuosly met with the error Name 'ddltest' is not declared. As you can see from the code below ddltest is an object with the ID ddltest. What am I doing wrong?
 Protected Sub ddltest_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)Dim MyVar As String = ddltest.SelectedItem.Value
 
If MyVar = "" Then
ErrorMessage.Text = "Please select a test"
Else
'Insert selection into databaseDim oConnection As New SqlConnection
Dim oCommand As SqlCommand
Dim sConnString As String
Dim sSQL As String
sConnString = "Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|xxxxx.mdf;Integrated Security=True;User Instance=false"oConnection = New SqlConnection(sConnString)
sSQL = "INSERT INTO testDB(Myxxxx) Values (@Myxxxx)"
oConnection.Open()oCommand = New SqlCommand(sSQL, oConnection)oCommand.Parameters.Add(New SqlParameter("@Myxxxx", MyVar))
oCommand.ExecuteNonQuery()
oConnection.Close()
ErrorMessage.Text = "You selected " & MyVar & " and it has been added to the database."
End If
End Sub
 
<asp:TemplateField HeaderText="Test">
<EditItemTemplate>
 
<asp:DropDownList ID="ddltest" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddltest_SelectedIndexChanged" >
<asp:ListItem Selected="True" Value="" ><-- Please Select a test --></asp:ListItem><asp:ListItem Value="1">1</asp:ListItem>
<asp:ListItem Value="2">2</asp:ListItem>
<asp:ListItem Value="3">3</asp:ListItem>
<asp:ListItem Value="4">4</asp:ListItem>
<asp:ListItem Value="5" >5</asp:ListItem>
</asp:DropDownList>
 
</EditItemTemplate>
</asp:TemplateField>

View 7 Replies View Related

Fill Dropdownlist

May 7, 2008

hi,
how can i fill dropdownlist through code not through visit.and i need to know which is fastest and easy way for web application throught this below query.
cmd.Connection = conn
conn.Open()Dim ds As New DataSet
cmd.CommandText = "SELECT Emp_Name,Emp_ID FROM Employee "
da.Fill(ds, "data")
cmd.ExecuteNonQuery()
conn.Close()

View 4 Replies View Related

Dropdownlist -default Value!!

Feb 3, 2004

hi ,

need your help please

I have got a dropdownlist which is getting it's items and values from the table with in SQL server , everything works fine.

I just want to be able to select default item , so when the page is loaded the dropdown list default will be that selected item.

as an exmple if the drop downlist items and values are as follow

item ----> value
---------------------
city -----> 1
tokyo -----> 2
london ------>3

these info is imported from the database
and I want by default tokyo to be selected

many thanks

M


----------------------------------------
here is my code:

Dim sqlConnection As SqlConnection
Dim sqlDataAdapter As SqlDataAdapter
Dim sqlCommand As SqlCommand
Dim dataSet As DataSet
Dim dataTable As DataTable


sqlConnection = New SqlConnection("user id=sa;password=testfirm;database=ken_live;server=csfirm03")

'pass the stored proc name and SqlConnection
sqlCommand = New SqlCommand("Select * From _aci",sqlConnection)

'instantiate SqlAdapter and DataSet
sqlDataAdapter = New SqlDataAdapter(sqlCommand)
dataSet = New DataSet()

'populate the DataSet
sqlDataAdapter.Fill(dataSet, "AA")

'apply sort to the DefaultView to sort by CompanyName
dataSet.Tables(0).DefaultView.Sort = "bsheet"
city.DataSource = dataSet.Tables("AA").DefaultView

city.DataTextField ="bsheet" ' what to display
city.DataValueField ="bsheet" ' what to set as value

city.DataBind()

View 15 Replies View Related

Inserting DropDownList Value Into DB

Jan 16, 2006

Hi... im trying to insert whatever value a user selects from a drop down list box into a database.
So I have already stated that there are 5 different options (eg. 1,2,3,4,5) so I want it that when someone selects '2' and then clicks a button it inserts '2' into a db... I tried the following (DDL is the id of the drop down list box) :
Dim myCommand As SqlCommandDim objUsers As SqlTransactionDim strnumber As String = DDL.SelectedValueconnstring = System.Configuration.ConfigurationManager.AppSettings("ConnectionString")conUsers = New SqlConnection(connstring)conUsers.Open()objUsers = conUsers.BeginTransaction
"INSERT INTO tblsomething (number) VALUES (strnumber)"
myCommand = New SqlCommand(strSQL, conUsers)myCommand.Transaction = objUsersmyCommand.ExecuteNonQuery()objUsers.Commit()conUsers.Close()
 - Anyway suffice to say that this isnt working sssooooo...... help. Please

View 3 Replies View Related

Populating Dropdownlist

Mar 23, 2006

I've got the following code and it's not really what I want. With the below code I can select in a dropdownlist a value and in the other dropdownlist the correspondending value will be selected. But when I select a value the second dropdownlist won't be filled with all the data in the database. It is filled only with the correspondending value and not with the rest of the value. When someone changes his mind and want to select a value in the dropdownlist it can't be done. Any ideas??Default.aspx:<body>    <form id="form1" runat="server">    <div>        <asp:Label            ID="Label1"            runat="server"            Text="Botanische Naam: ">        </asp:Label>        <asp:DropDownList            ID="DDL1"            AutoPostBack="True"            runat="server"            OnSelectedIndexChanged="ChangeBotanicName"            DataSourceID="SqlDataSource1"            DataTextField="Botanische_Naam"            DataValueField="Botanische_Naam">        </asp:DropDownList>        <asp:SqlDataSource            ID="SqlDataSource1"            runat="server"            ConnectionString="<%$ ConnectionStrings:BonsaiDataBaseConnectionString %>"            SelectCommand="SELECT [Botanische Naam] AS Botanische_Naam FROM [BonsaiSoorten]">        </asp:SqlDataSource>        <asp:sqldatasource           id="SqlDataSource2"           runat="server"           connectionstring="<%$ ConnectionStrings:BonsaiDataBaseConnectionString%>"           selectcommand="SELECT [Nederlandse Naam] AS Nederlandse_Naam FROM [BonsaiSoorten]WHERE [Botanische Naam] = @Title1">          <selectparameters>              <asp:controlparameter              name="Title1"              controlid="DDL1"              propertyname="SelectedValue"              />          </selectparameters>        </asp:sqldatasource>         <asp:Label            ID="Label2"            runat="server">Nederlandse Naam:</asp:Label>                <asp:DropDownList            ID="DDL2"            AutoPostBack="True"            runat="server"            OnSelectedIndexChanged="ChangeDutchName"            DataSourceID="SqlDataSource3"            DataTextField="Nederlandse_Naam"            DataValueField="Nederlandse_Naam">        </asp:DropDownList>        <asp:SqlDataSource            ID="SqlDataSource3"            runat="server"            ConnectionString="<%$ ConnectionStrings:BonsaiDataBaseConnectionString %>"            SelectCommand="SELECT [Nederlandse Naam] AS Nederlandse_Naam FROM [BonsaiSoorten]">        </asp:SqlDataSource>        <asp:sqldatasource           id="SqlDataSource4"           runat="server"           connectionstring="<%$ ConnectionStrings:BonsaiDataBaseConnectionString%>"           selectcommand="SELECT [Botanische Naam] AS Botanische_Naam FROM [BonsaiSoorten]WHERE [Nederlandse Naam] = @Title2">          <selectparameters>              <asp:controlparameter              name="Title2"              controlid="DDL2"              propertyname="SelectedValue"              />          </selectparameters>        </asp:sqldatasource>     </div>    </form></body>Default.aspx.vb:Partial Class _Default    Inherits System.Web.UI.Page    Sub ChangeBotanicName(ByVal Sender As Object, ByVal e As System.EventArgs)        DDL2.DataSourceID = "SqlDataSource2"    End Sub    Sub ChangeDutchName(ByVal Sender As Object, ByVal e As System.EventArgs)        DDL1.DataSourceID = "SqlDataSource4"    End SubEnd Class
P.S. I posted this before but can't find it anymore so here it is again

View 3 Replies View Related

DropDownList Attribute ????

Dec 11, 2007

can someone please tell me if you can implement a drop down list within a table attribute.

If anyone could show me an example please do.


Kind Regards

Rob

View 11 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved