473,378 Members | 1,360 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

listbox driving a formview

I am trying to set up a listbox as a selector for a formview

The listbox gets its data from an sql table, which is the same table
that is to be used in the formview.

For testing I have also used a details view.

It all works with the details view, but nothing appears in the
formview.

I admit I do not understand all these different properties and methods
but I think I need a formview, because I want the option to edit and
insert records.

My code is

Protected Sub ListBox1_SelectedIndexChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
lblDropDown.Visible = True
lblDropDown.Text = "RecnoID: " &
ListBox1.SelectedValue.ToString & " " & ListBox1.SelectedItem.Text

Dim myConn As String =
System.Web.Configuration.WebConfigurationManager.C onnectionStrings("Connect_PPLISTS").ConnectionStri ng

Dim strQuery As String = "Select * from lsts0_All where
__rowid='"
strQuery += ListBox1.SelectedValue & "'"
Response.Write(strQuery & "<BR />")
'Dim adapter As SqlDataAdapter = New SqlDataAdapter(strQuery,
myConn)
Dim adapter As New SqlDataAdapter(strQuery, myConn)

Dim dt As New DataTable("lsts0_All")

adapter.Fill(dt)
fmvDetails.DataSource = dt
fmvDetails.DataBind()
dtlDetails.DataSource = dt
dtlDetails.DataBind()
End Sub
Any help gratefully appreciated as I want to go to bed shortly

Midnight UK time

Richard

May 2 '06 #1
0 943

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: dburns | last post by:
I have an unbound ListBox and an unbound ComboBox on the same form. I have them both set up to display the values from the same field in the same table. The ListBox displays the correct values; the...
3
by: sck10 | last post by:
Hello, I am creating a form for users to enter information about a lab and the members of the lab. I have one form (FormView) that they use to enter information about that lab. The keyvalue is...
0
by: Vaidas Gudas | last post by:
I am getting this error: System.Web.UI.WebControls.ListControl.PerformDataBinding(IEnumerable dataSource) +970 System.Web.UI.WebControls.ListControl.OnDataBinding(EventArgs e) +80...
2
by: alanb | last post by:
This is driving me NUTS. I have a listbox bound to a datasource and it all works fine until I start deleting items from the class collection. The frustrating thing is that there is no pattern to...
7
by: Lorenzino | last post by:
Hi, I have a problem with bindings in a formview. I have a formview; in the insert template i've created a wizard control and inside it i have an HTML table with some textboxes bound to the...
0
by: mosscliffe | last post by:
Before I waste hours looking for a solution can anyone point me to an article or have sample code for the following. I have a table which has two foreign keys. I wish to enter those foreign...
4
by: J055 | last post by:
Hi I have 2 update buttons in my FormView ('Apply' and 'OK'). I want both buttons to update the data source but the 'OK' button should redirect afterwards. I can see which button is clicked...
2
by: sck10 | last post by:
Hello, I have 3 objects: LinkButton GridView FormView The LinkButton is used to open the FormView in Insert mode. The GridView provides a list of products. When the "Select" link is
0
by: =?Utf-8?B?TGFkaXNsYXYgTXJua2E=?= | last post by:
Hello, I read some msdn and other articles about how does databinding among DataSource controls and FormView / GridView controls works but I still don't fully understand to this blackbox. I have...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.