15,922,533 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Visual Basic questions
View Javascript questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 11793580 (Top 32 by date)
Member 11793580
3-Jul-15 1:03am
View
ya i did. I have used parameters for insert, update and delete in my code. where am i going wrong
Member 11793580
3-Jul-15 0:52am
View
This query is not working
Member 11793580
3-Jul-15 0:51am
View
I have tried everything i.e., REGEXP,wild cards, Autosuggest etc but everything in vain. I have used parameters in my code.my only worry is that am not able to display names in autosuggest textbox when i run my application
Member 11793580
2-Jul-15 1:00am
View
I have fixed that error. Now the problem is i am not able to get the list of names when i give part of a name i.e., when i give "da" in textbox it should display all the names starting with "da". I am able to get this in database but not through code.
Member 11793580
2-Jul-15 0:02am
View
I have fixed it. But the problem is i am not able to run the query through code. It is working fine when i execute it in DB
Member 11793580
1-Jul-15 2:39am
View
Hi all,
Even i am facing the same problem.When i give full name in search text box it is displaying correctly but when i want to give part of name it is not displaying. I am using winform in c#.
private void btnSearch_Click(object sender, EventArgs e)
{
if (txtSearch.Text == "" && txtSearch1.Text == "")
MessageBox.Show("Please enter S ID");
else
{
DataTable dtSearch = VMR.MySqlHelper.GetDataTable("select * from table_name where S_ID = '" + txtSearch.Text + "' OR Fellow_name like '%da%'");
if (dtSearch.Rows.Count > 0)
{
textBox1.Text = dtSearch.Rows[0]["S_ID"].ToString();
txtFellowname.Text = dtSearch.Rows[0]["Fellow_name"].ToString();
txtPositionheld.Text = dtSearch.Rows[0]["Position_held"].ToString();
Can ne1 please give a solution to this?
Member 11793580
30-Jun-15 3:13am
View
It is giving error as..Can't connect to localdatabase, table_name doesn't exist
Member 11793580
30-Jun-15 2:59am
View
it is there in database because when i execute
"select * from table_name;" all the rows are displayed
Member 11793580
30-Jun-15 2:55am
View
But if i mention %da% it will give only those two names.I want search criteria on all of the names in the database i.e., names starting from A till Z.
Member 11793580
30-Jun-15 2:46am
View
Deleted
S_ID Fellow_name
TCOF4.16 David
TCOF4.17 Dave
select * from table_name where S_ID = '" + txtSearch.Text + "' OR Fellow_name like '%A-Z%';
I cannot give S_ID because it is unique. I am giving "da" in textbox so that it should show me David and dave
Member 11793580
30-Jun-15 2:34am
View
Still zero rows are fetched.Any problem with datatable
Member 11793580
30-Jun-15 2:00am
View
When i run it in database it is displaying zero rows. but "select* from table_name" is giving all the rows
Member 11793580
30-Jun-15 1:40am
View
Deleted
May u please let me know how to work on Helper
Member 11793580
30-Jun-15 1:39am
View
Thanks for the response.
I replaced the query with the one u have given but it is not displaying names when i give part of name.
I have used parameters in insert code.
Member 11793580
30-Jun-15 0:29am
View
What exactly do u want me to check out? I mean with what can i replace?
Member 11793580
29-Jun-15 22:59pm
View
This i have already shared above. Neway can you please figure it out now
Member 11793580
29-Jun-15 22:58pm
View
Deleted
private void btnSearch_Click(object sender, EventArgs e)
{
if (txtSearch.Text == "" && txtSearch1.Text == "")
MessageBox.Show("Please enter S ID");
else
{
DataTable dtSearch = VMR.MySqlHelper.GetDataTable("select * from table_name where S_ID = '" + txtSearch.Text + "' OR Fellow_name = '" + txtSearch1.Text + "'");
if (dtSearch.Rows.Count > 0)
{
textBox1.Text = dtSearch.Rows[0]["S_ID"].ToString();
txtFellowname.Text = dtSearch.Rows[0]["Fellow_name"].ToString();
txtPositionheld.Text = dtSearch.Rows[0]["Position_held"].ToString();
//Gender
string Gender = "";
if (dtSearch.Rows[0]["Gender"].ToString() == "M")
rdoM.Checked = true;
if (dtSearch.Rows[0]["Gender"].ToString() == "F")
rdoF.Checked = true;
//, , , , , , , , , , , , , , , , , , , Image
txtDOB.Text = dtSearch.Rows[0]["DOB"].ToString();
txtQualification.Text = dtSearch.Rows[0]["Qualification"].ToString();
txtEmailID.Text = dtSearch.Rows[0]["Email_ID"].ToString();
txtPermanentAddr.Text = dtSearch.Rows[0]["Permanent_Addr"].ToString();
txtCity.Text = dtSearch.Rows[0]["City"].ToString();
txtState.Text = dtSearch.Rows[0]["State"].ToString();
txtMobile.Text = dtSearch.Rows[0]["Mobile"].ToString();
txtPRJID.Text = dtSearch.Rows[0]["Proj_ID"].ToString();
txtProjectname.Text = dtSearch.Rows[0]["Proj_name"].ToString();
txtPIname.Text = dtSearch.Rows[0]["PI_name"].ToString();
txtLabAddr.Text = dtSearch.Rows[0]["Lab_addr"].ToString();
txtDOJ.Text = dtSearch.Rows[0]["DOJ"].ToString();
txtProjDuration.Text = dtSearch.Rows[0]["Proj_duration"].ToString();
pictureBox1.ImageLocation = Application.StartupPath + "\\..\\..\\Resources\\Photos" + textBox1.Text + ".jpg";
}
else
{
MessageBox.Show("No Record found");
}
}
}
Member 11793580
29-Jun-15 3:14am
View
When i enter text in textbox and click on search button it is directly showing as "No record Found". but i am able to get the desired result if i provide whole of the fellow name.
Member 11793580
29-Jun-15 3:11am
View
Now i am not getting red mark and also there are no errors
Member 11793580
29-Jun-15 2:11am
View
Ya i have done but still not able to get.
Member 11793580
29-Jun-15 1:45am
View
string ConString=ConfigurationManager.ConnectionStrings["ConString"].ConnectionString;
In this line....it is showing red mark for configurationManager...thts d reason i removed connection string.
Member 11793580
29-Jun-15 1:40am
View
Should any assembly reference be added
Member 11793580
29-Jun-15 1:39am
View
Both
while running the application by typing text in textbox i am not able to get autosuggestion and search criteria also
Member 11793580
29-Jun-15 1:35am
View
Anything wrong with my code?
Member 11793580
29-Jun-15 1:34am
View
Yes i have done
Member 11793580
29-Jun-15 1:01am
View
Sorry to say that i am not able to get the solution yet.Thanks for the note,i'll c to it
Member 11793580
29-Jun-15 0:43am
View
Load event code
MySqlCommand cmd = new MySqlCommand("SELECT Fellow_name FROM table_name");
MySqlDataReader reader = cmd.ExecuteReader();
AutoCompleteStringCollection MyCollection = new AutoCompleteStringCollection();
while (reader.Read())
{
MyCollection.Add(reader.GetString(0));
}
txtSearch1.AutoCompleteCustomSource = MyCollection;
Member 11793580
29-Jun-15 0:38am
View
Deleted
private void btnSearch_Click(object sender, EventArgs e)
{
if (txtSearch.Text == "" && txtSearch1.Text == "")
MessageBox.Show("Please enter S ID");
else
{
string textboxValue = txtSearch1.Text;
DataTable dtSearch = VMR.MySqlHelper.GetDataTable("select * from table_name where S_ID = '" + txtSearch.Text + "' OR Fellow_name = '" + txtSearch1.Text + "'");
if (dtSearch.Rows.Count > 0)
{
textBox1.Text = dtSearch.Rows[0]["S_ID"].ToString();
txtFellowname.Text = dtSearch.Rows[0]["Fellow_name"].ToString();
txtPositionheld.Text = dtSearch.Rows[0]["Position_held"].ToString();
//Gender
string Gender = "";
if (dtSearch.Rows[0]["Gender"].ToString() == "M")
rdoM.Checked = true;
if (dtSearch.Rows[0]["Gender"].ToString() == "F")
rdoF.Checked = true;
//, , , , , , , , , , , , , , , , , , , Image
txtDOB.Text = dtSearch.Rows[0]["DOB"].ToString();
txtQualification.Text = dtSearch.Rows[0]["Qualification"].ToString();
txtEmailID.Text = dtSearch.Rows[0]["Email_ID"].ToString();
txtPermanentAddr.Text = dtSearch.Rows[0]["Permanent_Addr"].ToString();
txtCity.Text = dtSearch.Rows[0]["City"].ToString();
txtState.Text = dtSearch.Rows[0]["State"].ToString();
txtMobile.Text = dtSearch.Rows[0]["Mobile"].ToString();
txtPRJID.Text = dtSearch.Rows[0]["Proj_ID"].ToString();
txtProjectname.Text = dtSearch.Rows[0]["Proj_name"].ToString();
txtPIname.Text = dtSearch.Rows[0]["PI_name"].ToString();
txtLabAddr.Text = dtSearch.Rows[0]["Lab_addr"].ToString();
txtDOJ.Text = dtSearch.Rows[0]["DOJ"].ToString();
txtProjDuration.Text = dtSearch.Rows[0]["Proj_duration"].ToString();
pictureBox1.ImageLocation = Application.StartupPath + "\\..\\..\\Resources\\Photos" + textBox1.Text + ".jpg";
}
else
{
MessageBox.Show("No Record found");
}
}
}
Member 11793580
29-Jun-15 0:35am
View
Actually i have to serach based on ID and name.
My previous query was "select * from table_name where S_ID = '" + txtSearch.Text + "' OR Fellow_name = '" + txtSearch1.Text + "'"..which searches using both name and ID.
How do i modify this query?
Member 11793580
29-Jun-15 0:28am
View
i have done this but always "no record" message is displayed.
Member 11793580
26-Jun-15 1:50am
View
I have done winform using c# code and mysql for db.
Member 11793580
26-Jun-15 1:49am
View
Thanks for the response.
But i have already designed a web form and added search employee groupbox which has ID and First name. Like google search which searches based on patterns i want to search for a particular employee based on First name by giving only part of his/her name so that it displays all the names of employees based on that portion of given string.
Show More