Alright, as much as I've done CSharp, I've done very little with databases with it. So I'm just kind of messing around with,
learning how it works.
I am using the ADO.NET adapter provided with MySQL in a very simple web application.
I have the connection, data adapter, and typed datasets created. In response to a button submit, I perform the following:
accountsDataAda pter.Fill(accou ntsDS1);
Label_Accounts. Text = accountsDS1.acc ounts.Count.ToS tring();
The label gets set to 0 - even though there ARE accounts present in the table. In fact, if I instead do:
Label_Accounts. Text = accountsDataAda pter.Fill(accou ntsDS1).ToStrin g();
I correctly return 46.
Its possible its a problem in the custom data provider, but I wanted to be sure I was using it correctly first :)
Thanks!
--
Adam Clauss ca*****@tamu.ed u 2 1357
"Adam Clauss" <ca*****@tamu.e du> wrote in message news:eZ******** *****@tk2msftng p13.phx.gbl... Alright, as much as I've done CSharp, I've done very little with databases with it. So I'm just kind of messing around with, learning how it works. I am using the ADO.NET adapter provided with MySQL in a very simple web application. I have the connection, data adapter, and typed datasets created. In response to a button submit, I perform the following: accountsDataAda pter.Fill(accou ntsDS1); Label_Accounts. Text = accountsDS1.acc ounts.Count.ToS tring(); The label gets set to 0 - even though there ARE accounts present in the table. In fact, if I instead do: Label_Accounts. Text = accountsDataAda pter.Fill(accou ntsDS1).ToStrin g(); I correctly return 46. Its possible its a problem in the custom data provider, but I wanted to be sure I was using it correctly first :)
I'm a little confused by the syntax in the following lines:
accountsDataAda pter.Fill(accou ntsDS1);
Label_Accounts. Text = accountsDS1.acc ounts.Count.ToS tring();
Since a DataSet is a collection of DataTables, I have typically seen the Fill method used with two parameters, dataset comma tablename. For example:
accountsDataAda pter.Fill(accou ntsDS1, "Accounts") ; // or whatever table is named
Also, what is the 'accounts' property of accountsDS1? Shouldn't that be as follows:
Label_Accounts. Text = accountsDS1.Tab les["Accounts"].Rows.Count.ToS tring();
I don't know if these are actual syntax errors or a lack of understanding on my part.
- carl
I am not very use to with Typed Dataset Syntax, but I think accounts is your
Table, when you call ToString on DataAdapter's Fill method, it returns
number of rows in your table, try checking
accountsDS1.acc ounts.rows.coun t.tostring(). Pl. sorry abt the Typed DS
syntax, what I mean try to count the number of rows in Rows collection.
"Adam Clauss" <ca*****@tamu.e du> wrote in message
news:eZ******** *****@tk2msftng p13.phx.gbl... Alright, as much as I've done CSharp, I've done very little with databases
with it. So I'm just kind of messing around with, learning how it works. I am using the ADO.NET adapter provided with MySQL in a very simple web
application. I have the connection, data adapter, and typed datasets created. In
response to a button submit, I perform the following: accountsDataAda pter.Fill(accou ntsDS1); Label_Accounts. Text = accountsDS1.acc ounts.Count.ToS tring();
The label gets set to 0 - even though there ARE accounts present in the
table. In fact, if I instead do: Label_Accounts. Text = accountsDataAda pter.Fill(accou ntsDS1).ToStrin g();
I correctly return 46.
Its possible its a problem in the custom data provider, but I wanted to be
sure I was using it correctly first :) Thanks! -- Adam Clauss ca*****@tamu.ed u This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: hillscottc |
last post by:
I have two DataAdapters....1)daStandard does a SELECT *, and
2)daDuplicates uses a stored proc which returns only rows with some
duplicate data.
Problem is, when I butRefresh_Click and I have selected ALL, I am never
able to refresh the data to the DUPS subset of data.
Every click returns ALL records. If I choose DUPS the first time it
works once, but once I do ALL I can no longer get just the DUPS.
|
by: Alpha |
last post by:
I have a small Window application and through out the different forms I
create a different dataset. At the begining I used the Tools to drag and
drop the SqlDataAdapter, connection and dataset objects to the frist few
forms but then later I removed those and created these objects in my code.
I now see 3 datasets in the Solution Explorer panel part but not all the
datasets that I have in my codes. Are these 3 datasets leftover from the...
|
by: Vik |
last post by:
Is it possible to loop through all dataadapters on page?
Thanks
|
by: Jon Maz |
last post by:
Hi,
I just read the following in an old NG thread:
"when you use the adapter with a closed connection it will open it, do your
requested database access, and close it immediately. If you use the adapter
with an open connection the connection will continue to be open after the
adapter is done."
My DataLayer makes extensive use of DataAdapters to fill DataSets, and
|
by: JJ |
last post by:
Hi All,
On my webform in ASP.net I have dragged 4 SqlDataAdapters and have dropped
them to webform. I was wondering what is the norm for how many
SqlDataAdapters should be used in a webform? Is it better to code behind the
SqlDataAdapters instead of using the data controls on the webform generate it
for me? Will I experience a performance hit for using 4 SqlDataAdapters?
Also what is the pros and cons to using a Strong Typed Dataset...
| |
by: JohnT |
last post by:
Okay... I'm using VB.net (2003) and I am accessing an MS Access DB file.
I have two DataAdapters that I use to search for specific info. The two of
them are similar except one is a Date, the other is a String.
Currently they both work as I like and I can get my data as I want. What I'm
intersted in is seeing HOW I do a Global search for both cases. Here are my
two issues:
ISSUE 1:
|
by: GaryDean |
last post by:
We have been noticing that questions on vs.2005/2.0 don't appear to get much
in answers so I'm reposting some questions posted by some of the programmers
here in our organization that never got answered...
There are articles on the new TableAdapters where it says that a key new
advantage is that a single TableAdapter, which can have multiple queries,
can be used on multiple forms. Now that was in an article on using
TableAdapters with...
|
by: BillE |
last post by:
I'm trying to decide if it is better to use typed datasets or business
objects, so I would appreciate any thoughts from someone with more
experience.
When I use a business object to populate a gridview, for example, I loop
through a datareader, populating an array list with instances of a custom
class in the middle tier, and then send the array list up to the
presentation layer and bind the gridview to it.
If I use a typed dataset, I...
|
by: gardnern |
last post by:
We have X number of data sets, of Y length each.
For example...
Small, Medium, Large
and
Red, Green, Blue, Yellow
We need to generate a list of all possibilities
Small Red
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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: 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: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |