hi there,
I've been working on a movie library. I put a combobox on my form as a search engine. If user wants to search for a movie then type the title of the movie, all possible movie having that title will appear within the dropdown of the combobox. For example, if user typed letter m, all movies stored in the database having a title with m should appear automatically in the dropdown of combobox. If user wants to continue typing, ex. user typed ma, all movie title starting with ma will appear. It's already working. However, I'm getting error messages saying "Not allowed to chage the 'ConnectionStri ng' property while the connection (state = Open)." This error message appears everytime I'm typing more than one character on the combobox. It also appears when I deleted the string that I entered then typed a new one, but then, after displaying the error message, it still displays the result of what I typed before the error appeared. Here's the modified code:
I'm using mysql-connector-net-6.5.4 to connect the whole project to the database so I just called the Connect(). Any ideas would be greatly appreciated. I'm quite new to this as you can probably tell.
ps. sorry, I've already posted this question as a reply to the "
vb.net -- Enabling "Search" within a textbox..help me plzz" discussion. I've already posted my question before I noticed that the discussion was discussed last April 2009, I just thought that I should post my question as a new discussion. ^_^v
4 3329 PsychoCoder 465
Recognized Expert Moderator Contributor
You're trying to share the connection, then change it's properties while it's open. What does your Connect method look like?
-
Imports MySql.Data.MySqlClient
-
-
Module Connection
-
Public myConnectionString As String
-
Public STRSQL As String
-
Public myConn As New MySqlConnection
-
Public Sub Connect()
-
With myConn
-
Try
-
If .State = ConnectionState.Open Then
-
-
End If
-
myConnectionString = "Database=movie_lib;Server=localhost;Uid=root;Password="
-
.ConnectionString = myConnectionString
-
.Open()
-
'MsgBox("Successful Connection")
-
Catch ex As Exception
-
MsgBox(ex.Message, MsgBoxStyle.Critical, "Connection Error")
-
.Close()
-
End Try
-
End With
-
End Sub
-
Public Sub Disconnect()
-
With myConn
-
.Close()
-
.Dispose()
-
End With
-
End Sub
-
-
End Module
-
that's my connection module look like sir
PsychoCoder 465
Recognized Expert Moderator Contributor
When you check if the connection is open you do nothing in this If statement - If .State = ConnectionState.Open Then
-
-
End If
So just close your connection -
If .State = ConnectionState.Open Then
-
.Close()
-
End If
oh yeah!! it worked!!..why didn't I noticed that?? haha,thanks for the help sir :)
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: michela rossi |
last post by:
Hi,
I currently have a website (running on RedHat Linux) comprising a
large number of HTML files and PDF's. I currently use PHPMySearch
(http://phpmysearch.web4.hm/index.php) which is a simple crawler, but
is clever enough to crawl PDF's.
I'd like to change one area of the site so that it's webform driven
using a PHP/MySQL combo. This will allow me to provide a complex
search to users that enables users to search for particular...
|
by: Zaphod Beeblebrox |
last post by:
As much of this question relates to mysql, it may be OT?
I'm trying to make a search engine for a reasonably complex database that
was originally developed by someone else in Access. I've ported the data to
mySQL and am reasonably happy with everything except the performance I'm
getting from queries with multpile joins. Although the database is fairly
complex, it's not very large (less than 2 Mb as an Access db, less than that
in mysql...
|
by: Rod |
last post by:
Hi,
i am doing a ecommerce website and would like to implement a search engine
to find products.
All the serach engine I have found on the web are parsing html page!
This is not what i want.
i want to search within my mysql database.
But using:
- several columns (title, description)
- several tables (the product table is linked with another table which
|
by: Jordan |
last post by:
I have a standard look to my site so I thought I might just make all the
pages .asp pages and use #include statements to grab all the common content,
however I want to be sure that all the big search engines crawl it without a
problem. I heard that some have problems with ASP even if the ASP is not
that complicated.
|
by: Martien van Wanrooij |
last post by:
I have been using phpdig in some websites but now I stored a lot of larger
texts into a mysql database. In the phpdig search engine, when you entered a
search word, the page where the search word was found was displayed with
about 2 lines before and 2 lines behind the search word itself. Let us say
you look for "peanut butter" an the word is found in a larger text about
sandwiches, even when it is on the 40th line of the text you would get...
| |
by: hazly |
last post by:
I'm very new in the web technology and need advice on search engine. I
want to develop a portal using PHP and MySQL on Linux. Need to know on
the following features :
1. search engine that could search my portal (mySQL, PDF, Ms Word &
others)
2. search engine that could search to few web sites specified by
user/programmer
|
by: bb nicole |
last post by:
Below is my search engine for job portal which jobseeker can find the job through quick search. But it cant work... Is it mysql query got problem?? Thanx..
Interface
<html>
<head>
<title>UMS e-Job Portal</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
|
by: impin |
last post by:
thjis is my search form...
<form name="form" action="search.php" method="get">
<input type="text" name="q" />
<input type="submit" name="Submit" value="Search" />
</form>
this is my search.php
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |