CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!



Zone: > NEWSGROUP > Asp.Net Forum > migration_to_asp.net.migrating_from_php_to_asp.net Tags:
Item Type: NewsGroup Date Entered: 1/16/2007 1:34:00 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 3 Views: 26 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
4 Items, 1 Pages 1 |< << Go >> >|
ldechent
Asp.Net User
Pulling data from a database to put into a variable1/16/2007 1:34:00 AM

0/0

Hi:

I want to create a simple example of taking information from the database and putting it into a variable for use in code.

Example: There is a row in a three field database:  id=3, name=Jane Smith, debit balance=65.

I want it so that when she clicks a check box for an item that costs 50, it will go to the database (it knows her id is 3 so it will go to the row with the 3), and it will pull off the information, including the 65, so when it does the subtraction, it can see that she has enough money and it will proceed with the transfer.

What I need: I need to get that number 65 into a variable.

In PHP, we search the database and with a query and get the row with id=3, and store that information in an array.  From there, there is a PHP way to pull out what was in the field "debit balance", and put that into a variable. 

If I can do the same thing with ASP.NET 2.0 (from database to something to variable), I think I have it.

What I'm looking for: if you can give me a few key words for the "tools" or "things" that I need, that's it.  For example, when I started, someone told me "you want to do that with an SqlDataSource, a GridView and a FormView."  I like looking things up--I just need to know what to look up.  Thanks in advance.

-Larry

(I give green checkmarks when someone answers my question Big Smile)


Start with something simple that works.
jae.lee
Asp.Net User
Re: Pulling data from a database to put into a variable1/16/2007 2:22:12 AM

0/0

I can help, but have a question.

1. If you are able to get id=3 then why wouldn't you able to get debitbalance=65 (assuming you did something like "select * from table where id = 3")

2. How are you connecting to database? (sqlconnection, objectconnection, datatable)?

3. To get a function to be called when checkbox changes, use following:

<asp:CheckBox ID="checkbox" runat="server" OnCheckedChanged="yourfunction" AutoPostBack="true" />

This will invoke a function to get debitbalance (which is 65) and calculate against the price (which is 50)

Again, I need above answered so I can give a sample code for you to improvise.

Hope this helps.

Jae.


www.jaelee.com :: thoughts on .net development and related subjects
ldechent
Asp.Net User
Re: Pulling data from a database to put into a variable1/16/2007 2:45:32 AM

0/0

1. When they log in, the database is checked and the id corresponding to their login name will be carried from page to page.

(I think I see what you are saying--I have (actually more than) two problems to solve, and I only asked about one of them.  I'd feel it was wrong though to ask someone to solve all the problems in one question--and I'm hoping that when you "steer" me on this one I'll find other stuff to help finish it.)

I'm using an sqlconnection.

You've already helped me a lot :- ).  Your statement in 3 gives me the direction to go with the OnCheckedChanged="yourfunction" advice, and your sentence for 2 has just alerted me that sqlconnection isn't the only way to connect to a database so I will be looking up the other two (this might help with other aspects of my project).

Best regards,

-Larry


Start with something simple that works.
jae.lee
Asp.Net User
Re: Pulling data from a database to put into a variable1/16/2007 3:00:18 AM

0/0

Glad I could help, I would be glad to help your problems, just ask! :)

In terms of data connections, try using table adapter dataset. it utilitizes strict-typed data which means you are prone to less errors.
Also, table adapter dataset will manage your connection pool as well as caching automatically so you don't have to worry about connection managements (often cause of memory leak and stack in sql connection with ado)

Here is a good example on ASP.net (very simplified too)

http://www.asp.net/learn/dataaccess/tutorial01vb.aspx?tabid=63

It's long, but very good explanation of three-tier architecture (.net fundamentals)

It may take a while but try to read few beginning chapters on this article for good coding practices and fundamentals.

Hope this helps.

Jae.

 


www.jaelee.com :: thoughts on .net development and related subjects
4 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
MCITP SQL Server 2005 Database Administration Exam Guide: (Exams 70-431, 70-443, And 70-444) Authors: Darril Gibson, Pages: 752, Published: 2007
JavaScript Design Authors: William B. Sanders, Pages: 460, Published: 2001
Planting Flowers, Pulling Weeds: Identifying Your Most Profitable Customers to Ensure a Lifetime of Growth Authors: Janet Rubio, Patrick Laughlin, Pages: 288, Published: 2002
Teach Yourself C++ in 21 Days Authors: Josse Liberty, Bradley Jones, Pages: 911, Published: 2005
An Introductory Guide to SPSS for Windows Authors: Eric L. Einspruch, Pages: 145, Published: 2005
Server-side Flash: Scripts, Databases, and Dynamic Development Authors: William B. Sanders, Mark Winstanley, Pages: 458, Published: 2001
Single- and Multi-chip Microcontroller Interfacing: For the Motorola 68HC12 Authors: G. Jack Lipovski, Pages: 489, Published: 1999
Modeling with Data: Tools and Techniques for Scientific Computing Authors: Ben Klemens, Pages: 454, Published: 2008
Proceedings 2002 VLDB Conference: Proceedings of the Twenty-Eighth International Conference on Very Large Data Bases Hong Kong Sar, China 20-23 August 2002 Authors: VLDB, Pages: 1118, Published: -1
Programming .NET Web Services: web services Authors: Alex Ferrara, Matthew MacDonald, Pages: 396, Published: 2002

Web:
Pulling data from a database to put into a variable - ASP.NET Forums From there, there is a PHP way to pull out what was in the field "debit balance" , and put that into a variable. ...
Can someone tell me how to pull data out of MySQL database and ... "Can someone tell me how to pull data out of MySQL database and insert it into a session variable please?" - Find the answer to this question and millions ...
Claroline Support • View topic - Pulling data from the sql database Is it possible, without writing a php script, to pull a field or two ... Is there a way I can put a variable into a field on a document and ...
Pull info from MySQL database - PHP I have a database that I want query and pull an users specific details into a ... Thus, I use the $_REQUEST["id"] to put the id number into a variable and .... You should md5 it with a 'salt' or something, to protect your data access. ...
Pull variable into loop and assign value [Archive] - CodingForums.com [Archive] Pull variable into loop and assign value JavaScript programming. ... variable=new Array(type,size,color) data=new Array() ... I was hoping to put the variables into an array and then reference the variables ...
$ GET Variable from one form to another - creates ghost record I have one form where I do a search on one table in a database I have. ... of data into a second table in some sort of a looping action). .... My last post provided me a blank screen... when I modified it and put in the following: ... task I'm sure... lookup data on one form them pull one variable ...
Pulling data from a dataset into Ribbon.vb Pulling data from a dataset into Ribbon.vb. Hi , If my understanding is right, you just need to retrieve the data from the Database. ...
Pulling data from mySQL (PHP) - Recoil Forums Outputs the array (which is the data from the database been put into the .... than just to insert the variable into the string as you have done above. ...
easyAutoTrader and TinyMCE, will not save, help please ... I see where you are pulling that data out of the database, but not putting it in . .... properly getting the correct data to put into the database. ... variable called $_POST. With this variable we will also need to know ...

Videos:
p6apclps #23 Perl 6 Apocalypse http://www.perlfoundation.org/perl6 - - way to put character classes into correspondence. More problems show up when we extend the character set ...
An Introduction to SQLite Google TechTalks May 31, 2006 Richard Hipp ABSTRACT SQLite is a small C library that implements a self-contained, embeddable, zero ...
Cloud9 - Los Angeles KLAX - FS2004 Cloud9 - Los Angeles KLAX - FS2004 http://www.fscloud9.com/php/products.php?lang=EN&id=138 Los Angeles International # To install the ...
Debugging Backwards in Time Google TechTalks January 11, 2006 Bil Lewis Bil Lewis is a computer scientist who has worked on natural language understanding, expert ...
A Googly MySQL Cluster Talk Google TechTalks April 28, 2006 Stewart Smith Stewart Smith works for MySQL AB as a software engineer working on MySQL Cluster. He is an ...
Using Static Analysis For Software Defect Detection Google TechTalks July 6, 2006 William Pugh ABSTRACT I'll talk about some of my experience in using and expanding static analysis tools for ...
GTUG - Using the Google Collections Library for Java (2 of 2) 08/06/2008 - http://sv-gtug.org The Java Collections Framework is indispensable to nearly every Java developer. Yet, you may often find ...
Keynote with Jeffrey Veen - HighEdWeb 2008 Conference HighEdWeb 2008 Conference keynote by Jeffrey Veen, founding partner of Adaptive Path and project lead for Measure Map, the well-received web ...
The HEALING begins NOW (2 / 4) by Jonathan. YouTube user: adampants2007 & adampants2008.
Laser Surgery to treat the aches and ugliness of Varicose Veins The days of lengthy incisions, stitches and scars to treat varicose veins are gone at The Nebraska Medical Center in Omaha. Now, a laser fiber and ...




Search This Site:










migrating a php bot check application for flash to asp.net !!! seo !

convert simple php script to .aspx

php performance vs asp.net performance

which is $_request[variable] similar contol in asp.net

code to do the same as mysql_query, mysql_fetch_area and defining a session variable from one part of the mysql_fetch_array

moving all asp.net generated javascript to external files...?

reading serialized php cookie in asp.net

help on converting included "master" php files

convert php code to asp.net

help needed to install php to asp migration tool

migrating from php5/postgresql/propel to asp.net

help with php -> c# conversion.. binary unpacking...

assigning an html source in a variable

checking check boxes

converting php code to c# help

converting from html

associated arrays => hashtable ?

altering variables from sql then displaying

brave new world!

asp controls not working

join()

migration from php - looking for help

help on converting fsockopen() in php to asp.net

is asp.net overkill?

convert php script to asp.net c# help

how-to put data from a db into (for example) a session

nl2br() for c#

cron tab equivalent support?

retriving data from db and parsing

asp "wrapper" for php

  Privacy | Contact Us
All Times Are GMT