Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > .NET 3.5 and Visual Studio. 2008 > Visual Studio 2008
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Visual Studio 2008 For discussing Visual Studio 2008. Please post code questions about a specific language (C#, VB, ASP.NET, etc) in the correct language forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Studio 2008 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 17th, 2008, 07:19 PM
Authorized User
Join Date: Nov 2007
Location: Grimsby, North East Lincolnshire, United Kingdom.
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to chris1012
Default Filter not working grrrrr

hey guys am working on a program at the minute and its not running properly lol basically i've got an update record function but my filter button isn't working properly and i can't figure out why grrr" if any one could help me with this it would be greatly appreciated.

the code that am looking to get working is higlighed below in red the specific part of the code am getting an error with is this

[CustomersBindingSource.Filter = _
"CompanyName LIKE ’%" & filter.Trim & "%’ "]

__________________________________________________ _______________________
PublicClass Form1
PrivateSub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load
'TODO: This line of code loads data into the 'NorthwindDataSet.Customers' table. You can move, or remove it, as needed.
PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
PrivateSub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs)
PrivateSub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
'recognise record change with if statement'
If NorthwindDataSet.HasChanges Then
Dim DT As NorthwindDataSet.CustomersDataTable
DT = NorthwindDataSet.Customers.GetChanges()
If DT IsNotNothingThen
'catches errors in update'
Catch ex As Exception
'message box displays total number of updates'
MsgBox(DT.Rows.Count.ToString & _
" rows updated successfully.")

PrivateSub DataGridView1_CellContentClick_1(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
PrivateSub Filter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bttnFilter.Click
Dim filter AsString
filter = InputBox("Enter Company name")
CustomersBindingSource.Filter = _
"CompanyName LIKE ’%" & filter.Trim & "%’ "
PrivateSub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
Dim newRow AsNew DataRow = Customers.NewRow
"CompanyName") = "new company name"
newRow.Item("CustomerName") = "new customer name"
newRow.Item("ContactName") = "new contact name"

Thanks in advance Chris1012
in opposite world i love programming
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
window.opener working .... not working alyeng2000 Javascript How-To 5 January 5th, 2007 08:05 AM
Web.Config..Working or Not Working peace95 ASP.NET 1.0 and 1.1 Basics 1 September 18th, 2006 06:53 AM
Filter Help mcloum Classic ASP Databases 2 November 10th, 2005 05:40 PM
Filter Help mcloum BOOK: Beginning ASP 3.0 1 August 26th, 2005 03:10 PM
Local COM working , but not working at Web Serv nagen111 .NET Web Services 3 February 19th, 2005 04:22 AM

All times are GMT -4. The time now is 10:39 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.