473,800 Members | 2,541 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Accessing SQL dataset value from button

I apologize for the question in advance. I have lots of experience
with lots of other languages, but now I'm trying to accomplish
something with VB.NET Express. My experience with VB.NET express is
less than a week. I've gone through what appear to be the relevant
tutorials that came with the product, consulted the two reference books
I have, explored the source code that is being generated by my project,
and played around trying various things for about a day and a half now,
and since I'm sure there is a simple solution to what I am trying to
accomplish, I decided the time has come to just ask the experts.

I've built my SQL database, and VB.NET is connecting to it just fine,
displaying the value of each row as details. The form which is
displaying the data also has a couple of buttons, and when I click on a
button, I want to pass the values being displayed in the form's text
fields to an external subroutine. The call to the subroutine is going
just fine, and I can pass constants to it, but I'm having trouble
figuring out how to get the data values I want out of the text fields.

Let's say my database is called MyDatabase, the table I'm accessing is
MyTable1, and the column I want to pass is Name. How do I get the
currently-displayed value of "Name" into a variable I can pass to a
subroutine? Or, even better, what is the variable that already
contains this value in VB.NET Express? Thanks in advance to anyone who
can provide a solution.

May 7 '06 #1
5 2369
Okay, by my count, seven people who knew the answer have already read
this question and deemed it too simple to respond to. After trying all
kinds of Me.MyTable1.Tab leAdapter.Getda ta.Namecolumn variations, I
finally saw that a simple NameTextBox.Tex t had the value I wanted.
Thanks anyway; kudos to me.

May 7 '06 #2
Kudos to you!! :-)
Did you ever stop to think that maybe, those seven people that you say read
the post and knew the answer, may not have?
I read lots of posts in newsgroups but, that doesn't mean I know the answers
to every one of them. And , after re-reading your original post, there was
nothing there that would have helped anyone know that a simple
"NameTextBox.Te xt" had the value you were looking for. You didn't post any
of your code to help others help you. Not knowing what you had done so far,
(code wise) makes it hard to offer constructive suggestions or solutions.
Don't give up on asking for help when you need it. But, try to post some of
the code you are working with so if there is a simple solution, it might be
easier for others to help you find.
james




<no***********@ gmail.com> wrote in message
news:11******** ************@j7 3g2000cwa.googl egroups.com...
Okay, by my count, seven people who knew the answer have already read
this question and deemed it too simple to respond to. After trying all
kinds of Me.MyTable1.Tab leAdapter.Getda ta.Namecolumn variations, I
finally saw that a simple NameTextBox.Tex t had the value I wanted.
Thanks anyway; kudos to me.

May 7 '06 #3
Hey, I appreciate the feedback. The "seven people" was obviously a
joke, but I figure pretty much everyone on this newsgroup knows more
than I do, and thought somebody who knew the answer had probably moved
on to a more challenging problem without responding. From what you're
saying, maybe I was wrong.

As I say, I'm new to VB, and actually new to IDEs as well. Since the
pieces are all over the place, I didn't think posting my code would
help. The code I have in my View Code window just has the Form1 code
-- 3 private subroutines, one for Form1_Load, one for
TableBindingSav eNavigator_Clic k, and one for my Button1_Click. My
solution is there now in Button1_Click, but I hardly think that posting
what was there before would have been any more help than the
description of the problem I posted initially. Maybe I'm wrong about
that too.

Anyway, I do appreciate the feedback. Hopefully, the next time I need
help, I'll know enough to have a better idea of how to ask for it.

May 7 '06 #4
Nomail,

The biggest problem using Net is learn not to use your old methods anymore.

The most simple way to access data using Net is using the designers. They
are not often sufficient, however they have reached a stadium that it is
good to do.

Try this one, and know that all the code that is generated is viewable for
you by clicking in the solution explorer "show all files"

http://www.vb-tips.com/default.aspx?...2-b1ed16424252

I hope this helps,

Cor

<no***********@ gmail.com> schreef in bericht
news:11******** **************@ j73g2000cwa.goo glegroups.com.. .
I apologize for the question in advance. I have lots of experience
with lots of other languages, but now I'm trying to accomplish
something with VB.NET Express. My experience with VB.NET express is
less than a week. I've gone through what appear to be the relevant
tutorials that came with the product, consulted the two reference books
I have, explored the source code that is being generated by my project,
and played around trying various things for about a day and a half now,
and since I'm sure there is a simple solution to what I am trying to
accomplish, I decided the time has come to just ask the experts.

I've built my SQL database, and VB.NET is connecting to it just fine,
displaying the value of each row as details. The form which is
displaying the data also has a couple of buttons, and when I click on a
button, I want to pass the values being displayed in the form's text
fields to an external subroutine. The call to the subroutine is going
just fine, and I can pass constants to it, but I'm having trouble
figuring out how to get the data values I want out of the text fields.

Let's say my database is called MyDatabase, the table I'm accessing is
MyTable1, and the column I want to pass is Name. How do I get the
currently-displayed value of "Name" into a variable I can pass to a
subroutine? Or, even better, what is the variable that already
contains this value in VB.NET Express? Thanks in advance to anyone who
can provide a solution.

May 8 '06 #5
Keep in mind, that although this is a 24 hours newsgroup, is it in the
weekend less active than during working days.

As well is in my opinion your text by trying to describe everything not very
clear what you really want..

How can I put the value 1 in whatever textbox would have given you many of
these kind of answers.

MyTextbox.Text = "1"

or asking "how can I get the Text of a textbox in a string" would have been

dim myfield as string = myTextBox.Text

Now we probably all had the idea that it was an adonet question.

I hope this helps,

Cor


<no***********@ gmail.com> schreef in bericht
news:11******** ************@j7 3g2000cwa.googl egroups.com...
Okay, by my count, seven people who knew the answer have already read
this question and deemed it too simple to respond to. After trying all
kinds of Me.MyTable1.Tab leAdapter.Getda ta.Namecolumn variations, I
finally saw that a simple NameTextBox.Tex t had the value I wanted.
Thanks anyway; kudos to me.

May 8 '06 #6

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

Similar topics

2
2259
by: George Grodentzik | last post by:
I created a typed dataset from which I am trying to access the data. When I use the following code to access a row string name =dataset.person.firstName I receive an error System.IndexOutOfRangeException as if there are no rows. Yet when I dump the data to a file I receive (sample of file) <?xml version="1.0" standalone="yes"?><Dataset1 xmlns="http://tempuri.org/Dataset1.xsd"><Table><accountNo>1</accountNo><firstName>John ...
4
4448
by: Steve Donnor | last post by:
Here's my question.. I have a Dataset which has populated a datagrid with information from an AS400 That SQL looks like this "Select MASYS, MAFLD, MADATA, MAEQV from QS36F.MAPDATA WHERE MASYS = ? AND MAFLD = ? It populates a data adapter in which at that point I open a new dataset and I have the parameters and such setup including the proper update, insert and delete commands created as well. It works great I can update and insert and...
6
2747
by: Chris Styles | last post by:
Dear All, I've been using some code to verify form data quite happily, but i've recently changed the way my form is structured, and I can't get it to work now. Originally : The form is called "form1", and I have selects called "PORTA", "PORTB" ... etc...
4
2058
by: John Holmes | last post by:
I'm using data to rename some web controls on a form that uses a repeater contol and so it can have mulitple instances of the same control set. The controls get renamed (thanks to Steven Cheng's help) in a click event of the button that is pushed to enter data. Each time the button is clicked it sends the ID entered by the user to query the database and return information. The renamed controls then include the ID in the name of the...
5
1578
by: Craig G | last post by:
im having my first play about with caching a dataset but seem to be having some problems in doing so!! basically i have a dataset which i add to the cache as follows Cache.Insert("myDS", dsResults, Nothing, DateTime.Now.AddMinutes(5), TimeSpan.Zero) i then have a select button which i click so that the page is reloaded. so that i can only get the dataset from the cache
0
1579
by: N. Demos | last post by:
Hello, I'm having problems accessing a complex XML child node (latitude & longitude), and passing it to a function when the XML file has been read into a DataSet. Specifically, the returned object from accessing the 'latitude' and 'longitude' nodes is not a DataTable (as specified in the MSDN). I'm not sure what type is being returned, nor how to go about finding out. Any pointers would be appreciated. Below is the relevent Error message,...
0
2364
by: Siegfried Heintze | last post by:
This program works fine on my desktop when I grant full control of the MSAccess database to everyone. However, when I put it on my hosting service with no impersonation, I now get this error (see below). Can anyone suggest what the problem is? When I turn on impersonation, I get "unspecified error". See below. Thanks, Siegfried
7
3821
by: Chuck Anderson | last post by:
I'm pretty much a JavaScript novice. I'm good at learning by example and changing those examples to suit my needs. That said .... ..... I have some select fields in a form I created for a database search that I am unable to figure out how to access. (The search is implemented in Php/MySQL.) The user enters search values for: name, address1, city, .... etc., ..... and for each of these they also select whether the search should...
4
1971
by: SteveT | last post by:
I am wanting to populate several treeviews, one for the <TRs> group and one for the <TGsgroup. Is there a simplier way to populate the Treeview than the one I did below? It seems difficult to get to the correct DataSet values. <?xml version="1.0" encoding="utf-8" ?> <TestSample> <TRs> <TR1>
0
10274
jinu1996
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...
1
10251
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10033
tracyyun
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...
0
9085
agi2029
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...
0
5469
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2945
bsmnconsultancy
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...

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.