473,378 Members | 1,658 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Why can't i find a Row in a dataset?

Hi,

Currently had a Dataset that has information from the Northwind database, Customers table in it.

I have created my update and select commands and they work fine.

When I go to update a row in the data set I use this

//Get the datarow to edit
DataRow[] adrEdit = ds.Tables["Customers"].Select("CustomerID = 'txtCustomerID.Text'");

However this returns nothing, but if I do it explicitly like this

//Get the datarow to edit
DataRow[] adrEdit = ds.Tables["Customers"].Select("CustomerID = 'ALFKI'");

It works fine, why when I enter ALFKI in txtCustomerID.Text is it not making a match in the Dataset?

any help appreciated

Paul Custance
Nov 19 '05 #1
1 1145
Basically the filter is incorrect, you are not adding the text from the
customerID textbox.

DataRow[] adrEdit = ds.Tables["Customers"].Select("CustomerID = '" +
txtCustomerID.Text + "'");
--
Manohar Kamath
Editor, .netWire
www.dotnetwire.com
"Paul Custance" <pa**@sendmeanemail.net> wrote in message
news:eB**************@tk2msftngp13.phx.gbl...
Hi,

Currently had a Dataset that has information from the Northwind database, Customers table in it.
I have created my update and select commands and they work fine.

When I go to update a row in the data set I use this

//Get the datarow to edit
DataRow[] adrEdit = ds.Tables["Customers"].Select("CustomerID = 'txtCustomerID.Text'");
However this returns nothing, but if I do it explicitly like this

//Get the datarow to edit
DataRow[] adrEdit = ds.Tables["Customers"].Select("CustomerID = 'ALFKI'");

It works fine, why when I enter ALFKI in txtCustomerID.Text is it not making a match in the Dataset?
any help appreciated

Paul Custance

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: André Almeida Maldonado | last post by:
When I use this code: Dim dtsDataSet As DataSet = New DataSet("Dados") Dim dttUsuarios As DataTable = dtsDataSet.Tables.Add("Usuarios") Dim dtvUsuarios As DataView = New...
4
by: Matt | last post by:
Hello, Is it possible to find the size of a populated DataSet? I have an application (VB.Net) that that populates a DataSet and then sends that DataSet to a PDA. The application on the PDA...
4
by: CaptRR | last post by:
I think this is the right group to post to, so here goes. My problem is this, I cannot update the datarow to save my life. Been on this for 2 days now, and still am no closer to figuring it out...
3
by: André Almeida Maldonado | last post by:
When I use this code: Dim dtsDataSet As DataSet = New DataSet("Dados") Dim dttUsuarios As DataTable = dtsDataSet.Tables.Add("Usuarios") Dim dtvUsuarios As DataView = New...
2
by: google | last post by:
How can I find a DataRow in a DataSet by it's PrimaryKey value? This would be similar to an SQL statement such as "SELECT * FROM MyTable WHERE MyIndex = 2"... In the following code I've tried to...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.