Help... SQL
If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Hello,
seems if i use a separate search form to search my listview
it appears to load once and after a new search nothing happens
can anyone help me please.
after search:
seems if i use a separate search form to search my listview
it appears to load once and after a new search nothing happens
can anyone help me please.
after search:
Code: Select all
loading:
If FrmSearch.IsDisposed Then FrmSearch = New FrmSearch
If Not FrmSearch.IsDisposed Then FrmSearch.BringToFront()
If FrmSearch.ShowDialog(Me) = DialogResult.OK Then
If lstTrans.Visible Then
Try
Catch ex As Exception
End Try
End If
If lstloan.Visible Then
If searchbyname Then' boolean
SQl = "SELECT DISTINCT loananddebt.id,loananddebt.type,addresspayee.name,loananddebt.repayment,loananddebt.paid,loananddebt.date_,loananddebt.due,loananddebt.last_payment,users.name Relation FROM loananddebt LEFT JOIN addresspayee ON loananddebt.description=addresspayee.id LEFT JOIN users ON loananddebt.by=users.id where addresspayee.name LIKE '" & search & "%'"
StartSearchLoan()
End If
End If
End If
End Sub
Code: Select all
thanksDim SQLconnect As New SQLite.SQLiteConnection()
Dim SQLcommand As SQLiteCommand
Try
lstloan.Items.Clear()
lstloan.Controls.Clear()
ClearFields()
SQLconnect.ConnectionString = "Data Source=" & sPath & filename & ";"
If SQLconnect.State <> ConnectionState.Open Then 'open Conn just before execution
SQLconnect.Open()
End If
SQLcommand = SQLconnect.CreateCommand
SQLcommand.CommandText = SQl
Dim SQLreader As SQLiteDataReader = SQLcommand.ExecuteReader()
While SQLreader.Read()
If SQLreader(0).ToString = "" Then
empty_debt = "1"
Else
empty_debt = SQLreader(0)
End If
End While
SQLcommand.Dispose()
SQLconnect.Close()
visit us on:
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
it seems when i remove the searchbyname
it works like a charm
but how can i use this so it always reload the data after new search.
it works like a charm
but how can i use this so it always reload the data after new search.
visit us on:
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
so i guess no one has a clue?
thats sad :(
thats sad :(
visit us on:
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
I have no idea about this SQL stuff sorry :? . I'm not even sure what the question is to be honest :lol:
You open a search form which works first time, then if you try open it again it doesn't work?
You open a search form which works first time, then if you try open it again it doesn't work?
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
sometimes it can be a mess when i try to explain something 
well yes i open the search form
when i press ok it start this search part
so it loads the result name + data into the listview
when i try a new search open the search form again
and press ok nothing happens
the search part don't search again so thats my question
why it don't work when i use this searchbyname
if i remove the searchbyname part it works like a charm
but i need that part as well but it only works 1x
to load the new data

well yes i open the search form
when i press ok it start this search part
so it loads the result name + data into the listview
when i try a new search open the search form again
and press ok nothing happens
the search part don't search again so thats my question
why it don't work when i use this searchbyname
if i remove the searchbyname part it works like a charm
but i need that part as well but it only works 1x
to load the new data
visit us on:
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
Dummy1912 wrote:it seems when i remove the searchbynameReload is show new data in listview or new search on database?
it works like a charm
but how can i use this so it always reload the data after new search.
Next. Why
Code: Select all
If you dispose it after every execution why you won't simple do
If SQLconnect.State <> ConnectionState.Open Then 'open Conn just before execution
SQLconnect.Open()
End If
Code: Select all
?SQLconnect.Open()
Also
Code: Select all
should be changed to If ... Then ... Else ... End IfIf FrmSearch.IsDisposed Then FrmSearch = New FrmSearch
If Not FrmSearch.IsDisposed Then FrmSearch.BringToFront()
And you should check
Code: Select all
for any errors.StartSearchLoan()
and
ClearFields()
there are no errors.
and i already did do
why is it so hard to understand me??
and i already did do
Code: Select all
but like i said it only search the data 1x after a new search it does nothingIf FrmSearch.IsDisposed Then FrmSearch = New FrmSearch
If Not FrmSearch.IsDisposed Then FrmSearch.BringToFront()
If FrmSearch.ShowDialog(Me) = DialogResult.OK Then
End If
why is it so hard to understand me??
visit us on:
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
Dummy1912 wrote:there are no errors.I meant
and i already did do
Code: Select allbut like i said it only search the data 1x after a new search it does nothingIf FrmSearch.IsDisposed Then FrmSearch = New FrmSearch If Not FrmSearch.IsDisposed Then FrmSearch.BringToFront() If FrmSearch.ShowDialog(Me) = DialogResult.OK Then End If
why is it so hard to understand me??
Code: Select all
And have you tried toggling breakpoints on button click or somewhere near the start?If FrmSearch.IsDisposed Then FrmSearch = New FrmSearch
Else FrmSearch.BringToFront() End If
hello
i only tried with a messagebox under need it
and seems it showed the messagebox 1x
after new search no messagebox appearance.
so i have no clue why it only works one time.
i only tried with a messagebox under need it
and seems it showed the messagebox 1x
after new search no messagebox appearance.
so i have no clue why it only works one time.
visit us on:
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
Dummy1912 wrote:hello99% that breakpoint will solve this issue. Place iton button click event and "Step into" to see what blocks search.
i only tried with a messagebox under need it
and seems it showed the messagebox 1x
after new search no messagebox appearance.
so i have no clue why it only works one time.
Copyright Information
Copyright © Codenstuff.com 2020 - 2023