|
You'll have to write a little application to import these pic's into the database. There is no INSERT statement that will do it for you automatically.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am trying to create an autocomplete combobox that can be readonly. My problem is with my autocomplete handler, not properly selecting the text. If I type slow, I have no problems, however, if I type fast, the selection does not work correctly; the "auto-completed" text is not selected properly. Please Help!
Autocomplete code:
<br />
Private Sub CompletionCombo_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyUp<br />
Dim sTypedText As String<br />
Dim iFoundIndex As Integer<br />
Dim oFoundItem As Object<br />
Dim sFoundText As String<br />
Dim sAppendText As String<br />
<br />
If Me.Items.Count > 0 Then<br />
'Allow select keys without Autocompleting<br />
Select Case e.KeyCode<br />
Case Keys.Back, Keys.Left, Keys.Right, Keys.Up, Keys.Delete, Keys.Down, Keys.ControlKey, Keys.ShiftKey, Keys.Alt, Keys.ShiftKey, Keys.MButton, Keys.LButton, Keys.RButton, Keys.Home, Keys.End<br />
'e.Handled = False<br />
Exit Sub<br />
End Select<br />
<br />
'Get the Typed Text and Find it in the list<br />
If Me.Text.Length > 0 And Me.Text.Length <> Me.SelectedText.Length Then<br />
sTypedText = Me.Text<br />
iFoundIndex = Me.FindString(sTypedText)<br />
<br />
'If we found the Typed Text in the list then Autocomplete<br />
If iFoundIndex >= 0 Then<br />
'Get the Item from the list (Return Type depends if Datasource was bound <br />
' or List Created)<br />
oFoundItem = Me.Items(iFoundIndex)<br />
<br />
'Use the ListControl.GetItemText to resolve the Name in case the Combo <br />
' was Data bound<br />
sFoundText = Me.GetItemText(oFoundItem)<br />
<br />
'Append then found text to the typed text to preserve case<br />
sAppendText = sFoundText.Substring(sTypedText.Length)<br />
Me.Text = sTypedText & sAppendText<br />
<br />
'Select the Appended Text<br />
Me.SelectionStart = sTypedText.Length<br />
Me.SelectionLength = sAppendText.Length<br />
'Me.SelectedIndex = iFoundIndex<br />
End If<br />
End If<br />
End If<br />
End Sub<br />
<br />
Private Sub CompletionCombo_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Leave<br />
Dim iFoundIndex As Integer<br />
<br />
If Me.Items.Count > 0 Then<br />
Dim sFoundText As String = ""<br />
If Me.SelectedText.Length <> Me.Text.Length Then<br />
sFoundText = Me.Text.Substring(Me.SelectedText.Length, Me.Text.Length - Me.SelectedText.Length)<br />
End If<br />
If sFoundText.Length > 0 Then<br />
iFoundIndex = Me.FindString(Me.Text)<br />
<br />
Me.SelectedIndex = iFoundIndex<br />
End If<br />
End If<br />
<br />
End Sub<br />
Thanks,
Jake
|
|
|
|
|
I dont know if u like this, im using "one sub auto complete combobox" and this i took from VB.net articles here:
<br />
Private Sub ComboBox1_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles ComboBox1.KeyPress<br />
<br />
Me.ComboBox1.DroppedDown = True<br />
<br />
If Char.IsControl(e.KeyChar) Then Return<br />
<br />
With Me.ComboBox1<br />
<br />
Dim ToFind As String = .Text.Substring(0, .SelectionStart) & e.KeyChar<br />
<br />
Dim Index As Integer = .FindStringExact(ToFind)<br />
<br />
If Index = -1 Then Index = .FindString(ToFind)<br />
<br />
'dont allow typing from non collection combobox list items<br />
If Index = -1 Then<br />
e.Handled = True<br />
Return<br />
End If<br />
<br />
.SelectedIndex = Index<br />
.SelectionStart = ToFind.Length<br />
.SelectionLength = .Text.Length - .SelectionStart<br />
<br />
e.Handled = True<br />
<br />
End With<br />
End Sub<br />
And i have found a problem when i m using typing instead of selecting an item from the combobox collection. Why this can happen? If i select item from combobox and add row to datatable it has no problem but if i typed half then i press tab button keyboard (then text suppose auto complete) , when i add this to datatable it cause error and the error is came from unreadable combobox. If i seletect instead of typing , this error wont come out.
|
|
|
|
|
Hi All,
I know this is a silly question and i have done this before.
When i use the single quote in writing a sql query in vb, anything typed after the single quote is taken as comment. How to get rid of this.
this is my code
sql = "SELECT * FROM Building WHERE ID = '" & id& "'" And Index = '" & bldindex & "'"
Please help.
Cheers
|
|
|
|
|
This has has been gone over about a thousand times in the forums...
The simple way to fix it is to NOT use string concatenation to build your SQL statements. Doing this just opens you up to all kinds of problems and attacks. Always use parameterized queries, unless ABSOLUTELY necessary. The parameter objects will escape any bad characters, like the problem your having, and also check for attacks embedded in the parameters that could damage the database.
You can check out a couple of examples here[^], and here[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello,
It could be because you have an extra quote that is causing the problem...I have colored it red...
sql = "SELECT * FROM Building WHERE ID = '" & id & "'" And Index = '" & bldindex & "'"
I hope this helps,
Mitch
My sig:
"And it is a professional faux pas to pay someone else to destroy your computer when you are perfectly capable of destroying it yourself." - Roger Wright
Get Perpendicular! (Hitachi Storage)
My CodeProject Blog
Most recent blog post: April 11
|
|
|
|
|
Sorry for getting back this late. We finally decided to write back to the xml file instead of updating the database. Anyway this works for me.
Thanks for the help.
Cheers
|
|
|
|
|
Can someone help me, how to copy files, folders from the filelistbox to a desire location. Is it possible?. Im having the worst time trying to find any information that makes sense. Most of the websites start good but then, they get into this " I am god " Kind of thing.
Most of the books are not very explanatory. Can someone help, or at least show me some good sites. What do i need to do to get the right information?
|
|
|
|
|
Copy files from the FileListBox? What do you mean? What FileListBox?
Are you trying to make something like Explorer?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
yeah. Just that, but I want to specify special folders.
In other words I'm building a windows explorer look alike, but it will show the folders and files that i need. It's like a file management utility that will copy, move and archive my files.
A customize windows explorer.
|
|
|
|
|
OK. So I take it you have a directory tree on the left and when the user clicks on a node, the listbox on the right is populated with the filenames in that directory. Correct?
What exactly are you having a problem with? Getting a list of selected filnames?, actually doing the copy?, gettings some kind of destination?, Dragging and Dropping the selected files?, ...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am using a datagrid to display records. I can sort by any of the colums without a problem. Typeing anything into a colum and hiting enter drops the listing down to the correct key. The problem is that the row I typed the key into now contains the typed value along with all the other data on the record in the row. I need to either clear out the other data in the row or insert a new record with only the search key filed in. Any ideas how to do either of these things?
|
|
|
|
|
hi ppl,
i have a database with three columns namely first_name, second_name and third_name. and i want only the contents of first column i.e contents of first_name column to be displayed in a dropdownlist how do i do this.
thanks and regards
|
|
|
|
|
by using the following code u will be able to add data from first_name:
dim Cn as new adodb.connection
dim rs as new adodb.recordset
dim str as string
cn.Open "DSN-NAME", "UID", "PWD"
Set rS.ActiveConnection = cn
str_State = "Select DISTINCT FIELD-NAME from TABLE-NAME"
rs.Open str, cn, adOpenStatic, adLockReadOnly
For j = 1 To rs.RecordCount
cmbo1.AddItem rs.Fields(0).Value
rs.MoveNext
Next
If rs.State = 1 Then
rs.Close
Set rs = Nothing
End If
If cn.State = 1 Then
cn.Close
Set cn = Nothing
End If
|
|
|
|
|
Populate a dataset with data from the table containing the first_name columns.Then set the following properties of the combo-box(dropdown):-
ComboBox1.datasource = name-of-dataset.Tables(0)
ComboBox1.DisplayMember = "first_name"
ComboBox1.ValueMember = "first_name"
|
|
|
|
|
You can do it at run time by using code
Private myRow As DataRow
Private myCol As DataColumn
Private myTable As DataTable
myCol = myTable.Columns(0)
For Each myRow In myTable.Rows
ComboSample.Items.Add(myRow(0))
Next
or simply use
comboBox1.DataSource=dataSet
where dataset contains the required table.
Lata Agrawal
|
|
|
|
|
hi,
im using dhtledit control in vb6 for displaying html files.now i want to search word in that opened html files but without using FIND WINDOW.
Is there any way by which i can Select the word and highlight or move the cursor to that word.
e.g. if i want to find AND word in file it will select first AND word and then next AND and so on.
If any member of this forum knows it how to do then please write me.if possible give the source code.
Thanks in Advance
|
|
|
|
|
That component is so old, all the docs have been removed from Microsoft's site.
Check into using an embedded IE control for this.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i am using dhtmledit in VB. And i want know syntax and details about its parameters(specially execCommand method). if anyone knows please help
var1="and"
DHTMLEdit1.execCommand(DECMD_FINDTEXT, OLECMDEXECOPT_DONTPROMPTUSER,var1)
|
|
|
|
|
can anyone help me to develop irc chat in asp.net
Veeresh R M
|
|
|
|
|
Sorry, but that's not really a valid goal - irc is instant chat, and ASP.NET is based on a page being served when the user clicks on something. The best you could do is make your pages autopostback in a way that would kill your server with useless traffic.
Although, I believe there's an article on CP about having controls that talk to the server, I still don't see ASP.NET as the way to write a chat program.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
thank u for replying,
i tried to connect irc chat with tcpclient, it gave some following error,
i cld'nt understand it, plz help me out.
NOTICE AUTH :*** Looking up your hostname NOTICE AUTH :*** Checking Ident NOTICE AUTH :*** Couldn't look up your hostname :blueyonder2.uk.quakenet.org 451 * :Register first. :blueyonder2.uk.quakenet.org 451 * :Register first. :blueyonder2.uk.quakenet.org 451 * :Register first. :blueyonder2.uk.quakenet.org 451 * :Register first. :blueyonder2.uk.quakenet.org 451 * :Register first. :blueyonder2.uk.quakenet.org 451 * :Register first. ERROR :Closing Link: by blueyonder2.uk.quakenet.org (Registration Timeout) Cannot read from a closed TextReader.
|
|
|
|
|
The IRC server tried to reverse your IP address to get a DNS name. Apparently, you need to contact the owner of the IRC server to get an account first. At least that's what I think when it returns "Register first."
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
does anyone know about Dhtmledit executecommand option in detail. with exapmle VB6.0 please help
thanks in advance
|
|
|
|
|
Have anyone got this error : Unexpected Error (50003) when running VB6 application? I tried looking into the MSDN, but couldn't find the solution.
<italic>Work hard, Work effectively.
|
|
|
|