|
would you share it with us?
|
|
|
|
|
I ended using a global mouse hook to perform (and draw) mouse gestures. That way I can call my own procedures when the right mouse button down/up event is fired
|
|
|
|
|
please help
|
|
|
|
|
Boy, doing this[^] was really hard.
|
|
|
|
|
Hi everyone, I'm in need of a bit of guidance. I'm working on a little weather app and I'm got it all pretty much done. The app gets the local weather by zip code which the user inputs into a textbox. What I would like to do is have the app check the submitted zip code against a list of valid zip codes. Now, I have the list of zip codes and there are honestly more than I thought(approx. 43,180). I tried to hard code a string array with the zip codes but that caused visual studio to get too sluggish to use. Does anyone have any ideas on how I could check the users zip against the list of zip codes, or could you point me in the right direction? Thanks for any and all help.
Oh yeah, I forgot to mention I'm using vb.net.
|
|
|
|
|
|
Database to hold the data and possibly a ComboBox or TextBox, using AutoComplete, depending on your requirements.
|
|
|
|
|
There is something called a HybridDictionary .
Its optimized for performance and could resolve your issue by directly accessing the appropriate zip code.
|
|
|
|
|
|
Thanks guys. It looks like a database is the way to go.
|
|
|
|
|
Hi all,
I have made a datagridview textbox cell autocomplete. Now I want to get the values in the other cell associated with the autocomplete textbox cell from the database.
Like I have 4 Columns in my datagridview.
Col0 is ProductId (Primary Key)
Col1 is ProductName (Autocomplete)
Col2 is AvailableQty
Col3 is Rate
When I select the product from Col1 by Up or Down key, the other column cells would populate the data associated with the productname(Col1) from the database.
My question is how would I do that ?
I tried...
Private Sub DataGridView1_CellValueChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellValueChanged
If DataGridView1.CurrentCell.Value Is Nothing Then
Else
Try
OpenConnection()
Dim Sb1 As New StringBuilder
Sb1.Append("SELECT * FROM stockitems WHERE ProductName='" & Me.DataGridView1.CurrentRow.Cells(1).Value & "'")
Dim dbcommand As New MySqlCommand
dbcommand.Connection = conn
dbcommand.CommandText = Sb1.ToString
Dim dbread As MySqlDataReader = dbcommand.ExecuteReader
While dbread.Read
DataGridView1.CurrentRow.Cells(0) = dbread("ProductId")
DataGridView1.CurrentRow.Cells(2) = dbread("AvailableQty")
DataGridView1.CurrentRow.Cells(3) = dbread("Rate")
End While
dbread.Close()
Catch ex As Exception
MsgBox(ex.Message)
Finally
CloseConnection()
End Try
End If
End Sub
But nothing happened.
Then I tried...
Private Sub DataGridView1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles DataGridView1.KeyDown
If e.KeyCode = Keys.Down Then
Try
OpenConnection()
Dim Sb1 As New StringBuilder
Sb1.Append("SELECT * FROM stockitems WHERE ProductName='" & Me.DataGridView1.CurrentRow.Cells(1).Value & "'")
Dim dbcommand As New MySqlCommand
dbcommand.Connection = conn
dbcommand.CommandText = Sb1.ToString
Dim dbread As MySqlDataReader = dbcommand.ExecuteReader
While dbread.Read
DataGridView1.CurrentRow.Cells(0) = dbread("ProductId")
DataGridView1.CurrentRow.Cells(2) = dbread("AvailableQty")
DataGridView1.CurrentRow.Cells(3) = dbread("Rate")
End While
dbread.Close()
Catch ex As Exception
MsgBox(ex.Message)
Finally
CloseConnection()
End Try
End If
End Sub
But I failed.
Please help...
|
|
|
|
|
Is nobody there to solve me ?
|
|
|
|
|
If anyone knows the answer they will suggest it. In the meantime try running your code through the debugger to see what is happening.
Veni, vidi, abiit domum
|
|
|
|
|
I have an application using an ADODB connection to a DBase database (simple and easy to distribute). I captured the SQL string sent to the connection object using Quickwatch. I pasted the SQL statement into an SQL tool. I executed the SQL and it returned no rows which is correct. However when the same SQL string is passed to the ADODB connection it returns 189 rows.
Here is the code the initializes the ADODB connection:
strConn = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\DataStore;Extended Properties=DBASE III"
ConnDBF = New ADODB.Connection
ConnDBF.Open(strConn)
OK = ConnDBF.State
rstGRK = New ADODB.Recordset
rstGRK.CursorType = ADODB.CursorTypeEnum.adOpenStatic
Here is the SQL string being passed:
rstGRK.Open(SQLString, ConnDBF)
ResultCnt = rstGRK.RecordCount
Here is the SQL string:
<pre>SELECT BKL.BkShtName,
SRC.BookNo,
SRC.ChapNo,
SRC.VerseNo,
SRC.VerseText1,
SRC.VerseText2
FROM BIENBVS SRC,
BIBKLST BKL
WHERE SRC.BookNo = BKL.BookNumber
AND (SRC.VerseText1 LIKE '%frank jones%'
OR SRC.VerseText2 LIKE '%frank jones%' )
ORDER BY 2, 3, 4</pre>
The correct results is NO ROWS because the names begin with upper case. The ADODB connection returns 189 rows which is incorrect.
Does anybody have any ideas what could be going on and how to force the connection to be case sensitive?
|
|
|
|
|
The Jet database engine is inherently NOT case sensitive, so you have to force it to be.
I don't use Access (EVER!) but IIRC, you're looking for something like this:
SELECT ... FROM ... WHERE SRC.BookNo = BKL.BookNumber
AND (StrComp(SRC.VerseText1, "frank jones", 0) = 0
OR (StrComp(SRC.VerseText2, "frank jones", 0) = 0)
ORDER BY ...
|
|
|
|
|
The database is actually DBase (good reason to use, but it is a long explanation).
I converted the VB app to use OdbcConnection & OdbcDataReader methods and the ODBC DSN created with driver - "Microsoft dBase Driver (*.dbf)" . The results are the same - the query in VB still refuses to be case-sensitive.
If I put a breakpoint in the code and capture the SQL string and paste the string verbatim into WinSQL (an SQL tool using the same exact ODBC DSN), and execute the query, no results are returned.
The query behaves differently in VB that in an SQL tool using the exact same driver and ODBC definition.
Do not know why it works differently in VB than in WinSQL !!!!!
|
|
|
|
|
I have no idea since I don't have any access to any dBase databases. Thats one I have used since 1986.
I have no idea how to make it case sensitive for dBase.
|
|
|
|
|
I played around with this bit and was perplexed by your problem with case-insensitivity as I was not seeing it. That was until I noticed that you included an "Order By" clause. At least on my end, it is the "Order By" that makes it case-insensitive. Weird!
I only used a single table, so I don't know if that will effect anything, but it may worth a try to drop the "Order By" clause and see what happens.
If that resolves the issue, you could load a DataTable with your query results and apply a sort on the DefaultView to achieve the needed sort order.
Good Luck.
|
|
|
|
|
I tried removing the "ORDER BY" clause, but the results were the same.
However, after running the query from within VB, I ran the same exact query in WinSQL and it returned multiple rows. Then I ran it a second time and it returned 0 rows. Running it a 3rd and 4th time still returned 0 rows.
I returned to VB and ran the query again. Then I reran it in WinSQL and the first time the query returned many rows and the 2nd, 3rd, 4th, ..... runs returned 0 rows. This behavior is repeatable.
That tells me that the VB app is setting some unknown property that is causing the query to be case-insensitive.
I am going to turn SQL tracing on and see if I can find a difference in the SQL.LOG created from VB and the SQL.LOG created by a good run in WinSQL.
Don't you just love it when the application/objects help you by doing something you did not ask it/them to do !!!!!
|
|
|
|
|
Based on a suggestion from someone on another forum, and mega frustration, I decided to abandon the current ODBC DSN. I found and installed a Visual FoxPro driver and created a new DSN using that driver.
The query is now case-sensitive as it should be.
|
|
|
|
|
How To select audio track use vb.net using cronoapi.dll?
|
|
|
|
|
Never heard of it.
I have no idea where you got it from, so I don't know where you should ask about it either.
You ask the people who write the .DLL about how to use it.
|
|
|
|
|
ChronoTron[^] it seems.
Keep Clam And Proofread
--
√(-1) 23 ∑ π...
And it was delicious.
|
|
|
|
|
Yeah, I Goggled the sh*t out of the .DLL name and came up empty. Either way, the advice is still the same. ask the people who wrote it, not the people who are guessing at what you're using!
|
|
|
|
|
Dave Kreskowiak wrote: Goggled
That's your issue, you needed to Google it!
Keep Clam And Proofread
--
√(-1) 23 ∑ π...
And it was delicious.
|
|
|
|