473,385 Members | 1,569 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,385 software developers and data experts.

Passing variable to DataView

Hello all

I am trying to pass a variable to a DataView so that I can filter the rows displayed in my datagrid.

Here's the code I am trying to get to work

Private Sub btnClientSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClientSearch.Click

s_customerID = txtCustomerID.Text

MsgBox("Client ID is " + s_customerID)

daTamDataFiles.SelectCommand = cmdSelectTransactions

daTamDataFiles.Fill(dsStatementData.Transactions)

dvTransactions.RowFilter = "CustomerID = s_customerID"

End Sub

The error that I get is that s_customerID is not a row, and it isn't, it's the variable that contains some data that I want to filter the rows on, namely the customerID which is a 7 digit alpha numeric code.

dvTransactions is the dataview whose Table property is dsStatementData.Transactions

so what I am trying to do is fill the dsStatementData.Transactions table, show it in my data grid called gridTransactions using a filtered DataView. If I replace the text s_customerID with a customerID ex 'RUMSDO1' quotes and all. I get the rows filtered for that client ID.

Any help would be greatly appreciated.

John - supreme VB.net noob (pronounced 'newbie')

Nov 20 '05 #1
3 3851
Hi,

dvTransactions.RowFilter = "CustomerID = '" + s_customerID +"'"

Ken
----------------------
"John Wildes" <sp******@kissoff.com> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl...
Hello all

I am trying to pass a variable to a DataView so that I can filter the rows displayed in my datagrid.

Here's the code I am trying to get to work

Private Sub btnClientSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClientSearch.Click

s_customerID = txtCustomerID.Text

MsgBox("Client ID is " + s_customerID)

daTamDataFiles.SelectCommand = cmdSelectTransactions

daTamDataFiles.Fill(dsStatementData.Transactions)

dvTransactions.RowFilter = "CustomerID = s_customerID"

End Sub

The error that I get is that s_customerID is not a row, and it isn't, it's the variable that contains some data that I want to filter the rows on, namely the customerID which is a 7 digit alpha numeric code.

dvTransactions is the dataview whose Table property is dsStatementData.Transactions

so what I am trying to do is fill the dsStatementData.Transactions table, show it in my data grid called gridTransactions using a filtered DataView. If I replace the text s_customerID with a customerID ex 'RUMSDO1' quotes and all. I get the rows filtered for that client ID.

Any help would be greatly appreciated.

John - supreme VB.net noob (pronounced 'newbie')

Nov 20 '05 #2
Ken

Thanks much, going forward, is this how I would reference variables in properties like this ?

john

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message news:eW**************@TK2MSFTNGP12.phx.gbl...
Hi,

dvTransactions.RowFilter = "CustomerID = '" + s_customerID +"'"

Ken
----------------------
"John Wildes" <sp******@kissoff.com> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl...
Hello all

I am trying to pass a variable to a DataView so that I can filter the rows displayed in my datagrid.

Here's the code I am trying to get to work

Private Sub btnClientSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClientSearch.Click

s_customerID = txtCustomerID.Text

MsgBox("Client ID is " + s_customerID)

daTamDataFiles.SelectCommand = cmdSelectTransactions

daTamDataFiles.Fill(dsStatementData.Transactions)

dvTransactions.RowFilter = "CustomerID = s_customerID"

End Sub

The error that I get is that s_customerID is not a row, and it isn't, it's the variable that contains some data that I want to filter the rows on, namely the customerID which is a 7 digit alpha numeric code.

dvTransactions is the dataview whose Table property is dsStatementData.Transactions

so what I am trying to do is fill the dsStatementData.Transactions table, show it in my data grid called gridTransactions using a filtered DataView. If I replace the text s_customerID with a customerID ex 'RUMSDO1' quotes and all. I get the rows filtered for that client ID.

Any help would be greatly appreciated.

John - supreme VB.net noob (pronounced 'newbie')

Nov 20 '05 #3

hi,

Yes.

Ken
----------------
"John Wildes" <sp******@kissoff.com> wrote in message news:e6**************@TK2MSFTNGP09.phx.gbl...
Ken

Thanks much, going forward, is this how I would reference variables in properties like this ?

john

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message news:eW**************@TK2MSFTNGP12.phx.gbl...
Hi,

dvTransactions.RowFilter = "CustomerID = '" + s_customerID +"'"

Ken
----------------------
"John Wildes" <sp******@kissoff.com> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl...
Hello all

I am trying to pass a variable to a DataView so that I can filter the rows displayed in my datagrid.

Here's the code I am trying to get to work

Private Sub btnClientSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClientSearch.Click

s_customerID = txtCustomerID.Text

MsgBox("Client ID is " + s_customerID)

daTamDataFiles.SelectCommand = cmdSelectTransactions

daTamDataFiles.Fill(dsStatementData.Transactions)

dvTransactions.RowFilter = "CustomerID = s_customerID"

End Sub

The error that I get is that s_customerID is not a row, and it isn't, it's the variable that contains some data that I want to filter the rows on, namely the customerID which is a 7 digit alpha numeric code.

dvTransactions is the dataview whose Table property is dsStatementData.Transactions

so what I am trying to do is fill the dsStatementData.Transactions table, show it in my data grid called gridTransactions using a filtered DataView. If I replace the text s_customerID with a customerID ex 'RUMSDO1' quotes and all. I get the rows filtered for that client ID.

Any help would be greatly appreciated.

John - supreme VB.net noob (pronounced 'newbie')

Nov 20 '05 #4

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

Similar topics

3
by: domeceo | last post by:
can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) {...
58
by: jr | last post by:
Sorry for this very dumb question, but I've clearly got a long way to go! Can someone please help me pass an array into a function. Here's a starting point. void TheMainFunc() { // Body of...
7
by: Harolds | last post by:
The code below worked in VS 2003 & dotnet framework 1.1 but now in VS 2005 the pmID is evaluated to "" instead of what the value is set to: .... xmlItems.Document = pmXML // Add the pmID...
2
by: Tom Lee | last post by:
Hi all, I have the following problem and I cannot solve it. If anyone can help me solve this problem. I use the following code <%#DataBinder.Eval(Container.DataItem, "Property")%> to display...
1
by: Jim via DotNetMonster.com | last post by:
Hi, I'm assigning the value of a variable(MotivateNumber) in a Dataview object of a dataset. I get the correct value in the dataset. When I try to run the function to get the value I get a 0....
1
by: Larry Bird | last post by:
I've successfully created a dataview that I want to passing to another subroutine. See Example below: Creation of dataview: For Each CriteriaDetailRow In...
2
by: hcs | last post by:
Hello, i have a form which has a datagrid and another which displays some information. what i would like is to be able to double click a row on the datagrid on form B and then display the select...
12
by: Andrew Bullock | last post by:
Hi, I have two classes, A and B, B takes an A as an argument in its constructor: A a1 = new A(); B b = new B(a1);
3
by: DaTurk | last post by:
If I call this method, and pass it a byte by ref, and initialize another byte array, set the original equal to it, and then null the reference, why is the original byte array not null as well? I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.