|
I am trying to read blobs from a field in a database table. The blobs hold resumes and each resume can have one or many corresponding professions in the Professions field. I am trying to enable users to look up resumes forcertain professions by choosing one or many professions in the listbox. The Select statement selects my table where the text of the listitem chosen by the users match the profession in the Professions field.
|
|
|
|
|
on which event u call this code?
Best Regard
Pathan
GOD HELP THOSE WHO HELP THEMSELVES
|
|
|
|
|
Imran Khan Pathan is right... I didn't see it the first time but you are doing something like these
You have a "for" that walks through the listBox2 elements and sees which is selected...then you make a query in the database (inside that "for") and you bind the result of the query with the same listBox2...these alters the containt of the listBox2 and the for is not working anymore (ListBox2.Items.Count is not the same after you have done the binding in the "for" statement and also the ListBox2.Items are changed)
Just call me Valy...
|
|
|
|
|
You are changing the items of the list box while you are looping through the items.
---
single minded; short sighted; long gone;
|
|
|
|
|
I've used the for loop to determine the list item selected by the user. Then I used the select statement to select the profession that is equal to the text of the list item that was selected. If I change the contents of listbox2 during each iteration of the loop when I bind the data to listbox2, then does that mean I can't use the for loop like I did? Should I bind the data out side of the for loop? I'm going to try and change the sequence of my code, but please give me some suggestions on how to remedy this code.
|
|
|
|
|
Try here...[^]
Rhys
"The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it"
They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance."
Terry Pratchett
|
|
|
|
|
Try this code
But dont call this function on Page Load Event if ur ListBox2'items are empty.
Dim i As Integer<br />
<br />
Dim myCon As New OdbcConnection<br />
<br />
myCon = New OdbcConnection("Driver={MySQL ODBC 3.51 Driver};Server=myServer;Database=myDB;User=myUserassword=myPass;Option=3;")<br />
<br />
For i = 0 To ListBox2.Items.Count - 1<br />
If ListBox2.Items(i).Selected Then<br />
<br />
Dim cmd As New OdbcCommand("SELECT * FROM myTable where Professions = '"& ListBox2.Items(i).Text &"' ")<br />
<br />
End If<br />
<br />
Next<br />
<br />
<br />
myCon.Open()<br />
<br />
cmd.Connection = myCon<br />
<br />
Dim ds As New DataSet<br />
<br />
Dim ad As New OdbcDataAdapter(cmd)<br />
<br />
ad.Fill(ds)<br />
<br />
Me.ListBox2.DataSource = ds<br />
<br />
Me.ListBox2.DataTextField = "Professions"<br />
<br />
Me.ListBox2.DataBind()<br />
<br />
<br />
Best Regard<br />
Pathan
GOD HELP THOSE WHO HELP THEMSELVES
|
|
|
|
|
does crystal of asp.net 2003, dont have any problems if uploaded on a windows 2000/2003 server???
start a new beginning in every ending; thats what life for......
|
|
|
|
|
i have datalist in that i used item templates as linkbutton and a datalist.. i used to click on the linkbutton to show the item template datalist..but i hav to referesh the page on each click on the linkbuton...hw can i do that?\
plz help me..
thanks
|
|
|
|
|
regimol wrote: i used item templates as linkbutton and a datalist.
Do you mean one more datalist inside ?
regimol wrote: .but i hav to referesh the page on each click on the linkbuton...hw can i do that
Now how you are showing datalist ?
|
|
|
|
|
yes...
its like..
all employee-id,s in thed link button.
all employee details in the data list..
but if i click on emp-1 hav to show the details of that emplyee.n tn click on emp2 have to refresh that page n shoe only emplyee 2 details...
|
|
|
|
|
First Bind all data on page load event
After that U can call javascript fnuction to show or hide inner datalist on click of LinkButton
Best Regard
Pathan
GOD HELP THOSE WHO HELP THEMSELVES
|
|
|
|
|
or hw can i do like this community?if i click on one qu it'll pop out..n if click once again it'll popup??
|
|
|
|
|
Take datalist in div tag and apply style="display:none;"
Javascript function
function visibility(divId)
{
if(document.GetElementById('divId').style.display=="none")
document.GetElementById('divId').style.display="block"
else
document.GetElementById('divId').style.display="none"
}
Best regard
Pathan
GOD HELP THOSE WHO HELP THEMSELVES
|
|
|
|
|
I have some problem to convert vb6 to vb.net.. I m using the convertor "Transking".How to add the vb project in Transking. and how to get complete asp.net project.. Pls reply soon plz plz..............
Raja
-- modified at 5:01 Wednesday 11th July, 2007
|
|
|
|
|
What specific problem are you having?
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
hi.
i am in interview of machine test...
help me please.
i need event in datagrid
when we clicking cell of datagrid using mouse then that particular cell color has to be chaged.
how can i do........
can anyone help me.......
thanking u..
|
|
|
|
|
just on mouse click or is that a button????
I was born dumb!!
Programming made me laugh !!!
--sid--
|
|
|
|
|
You can have a look at this.[^]
Apurva Kaushal
|
|
|
|
|
Apurva Kaushal wrote: You can have a look at this.[^]
It's for windows applications
|
|
|
|
|
In your datagrid create template columns. Create table inside templatecolumns. Make each row as runat=server. Call javascript function like changeColor(obj) on onclick event of table row. Inside script use styles to change the color.
|
|
|
|
|
hi.......
how to get event in datagrid
help me please....
|
|
|
|
|
Which event you want?
Apurva Kaushal
|
|
|
|
|
Need we to give code for paging in server side???
i set AllowPaging=true and in template coloum i add a check box...
i get an error "The GridView 'GridView1' fired event PageIndexChanging which wasn't handled."
Thks
|
|
|
|
|
You need to handle the pageindexchange event for the gridview.
something like this:
Gridview1.pageindex = e.newpageindex
Gridview1.selectedindex = -1
Bind the Gridview (need to bind the grid with the datasource)
Apurva Kaushal
|
|
|
|