Saving parameters to database
Saving parameters to database
Saving parameters to database
Saving parameters to database
Saving parameters to database
Saving parameters to database Saving parameters to database Saving parameters to database Saving parameters to database Saving parameters to database Saving parameters to database Saving parameters to database Saving parameters to database
Saving parameters to database Saving parameters to database
Saving parameters to database
Go Back  Xtreme Visual Basic Talk > > > Saving parameters to database


Reply
 
Thread Tools Display Modes
  #1  
Old 02-12-2013, 06:14 AM
Solar Dragon Solar Dragon is offline
Newcomer
 
Join Date: Feb 2013
Posts: 11
Default Saving parameters to database


Hello,
Is there any way of saving parameters that aren't text in text boxes into a database?

I have a pop-up box that lists the result and grade. I want to save these into an Access database but am unsure of how, without putting them into text boxes.

Thanks in advance.
Reply With Quote
  #2  
Old 02-12-2013, 10:27 AM
Gruff's Avatar
GruffSaving parameters to database Gruff is offline
Bald Mountain Survivor

Retired Moderator
* Expert *
 
Join Date: Aug 2003
Location: Oregon, USA - deceased
Posts: 6,440
Default

by Pop-up box do you mean a message box?

You could simply use one of the many conversion tools.
To convert text into a number.

Such as Single.TryParse()
Single is a low order floating point number variable.
Code:
Public Class Form1 Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click Textbox1.text = "44.5" Dim Grade As Single If Single.TryParse(Textbox1, Grade) Then MessageBox.Show("Is a Number") 'Add Grade to database Else MessageBox.Show("Is not a Number") 'Warn user End If End Sub End Class
__________________
Burn the land and boil the sea
You can't take the sky from me


~T
Reply With Quote
  #3  
Old 02-12-2013, 11:32 AM
hDC_0Saving parameters to database hDC_0 is offline
Contributor

* Expert *
 
Join Date: Feb 2004
Posts: 559
Default inserting data to access without using textboxes or datagridview control

Just in case Gruff's solution doesn't really get the issue that Solar Dragon may be having.

Many of the tutorials about saving, adding, or inserting data into an Access Database,
(use an “OdbcConnnection” object).

Most of these tutorials use either textboxes or a bound datagridview for saving the data.

However when you are using a messagebox you usually use just text in quotes or
a text assigned (dimmed) to a string variable, using either the MessageBox class or the MsgBox function.

Take a look at step 7 on this page.
Please note on the INSERT statement line:
"INSERT INTO myTable VALUES('JOHN','SMITH')"

So if result was "96" and grade was "A", then you could use:
"INSERT INTO myTable VALUES('95','A')"

Is that the kind of thing you are asking about?

Last edited by hDC_0; 02-12-2013 at 12:21 PM.
Reply With Quote
  #4  
Old 02-12-2013, 11:50 AM
Solar Dragon Solar Dragon is offline
Newcomer
 
Join Date: Feb 2013
Posts: 11
Default

Thanks for the responses but I managed to figure out another way to do what I was trying to do.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Saving parameters to database
Saving parameters to database
Saving parameters to database Saving parameters to database
Saving parameters to database
Saving parameters to database
Saving parameters to database Saving parameters to database Saving parameters to database Saving parameters to database Saving parameters to database Saving parameters to database Saving parameters to database
Saving parameters to database
Saving parameters to database
 
Saving parameters to database
Saving parameters to database
 
-->