Click here to Skip to main content
15,888,351 members
Home / Discussions / Database
   

Database

 
GeneralRe: How to create and use Alias Name for the Database Pin
indian1438-Feb-16 20:24
indian1438-Feb-16 20:24 
GeneralMessage Closed Pin
9-Feb-16 20:16
david_smith019-Feb-16 20:16 
GeneralRe: How to create and use Alias Name for the Database Pin
Mycroft Holmes9-Feb-16 21:38
professionalMycroft Holmes9-Feb-16 21:38 
GeneralRe: How to create and use Alias Name for the Database Pin
Richard Deeming10-Feb-16 1:35
mveRichard Deeming10-Feb-16 1:35 
Questionkilling processes on mysql Pin
Gilbert Consellado6-Feb-16 21:55
professionalGilbert Consellado6-Feb-16 21:55 
AnswerRe: killing processes on mysql Pin
Gilbert Consellado7-Feb-16 23:18
professionalGilbert Consellado7-Feb-16 23:18 
AnswerRe: killing processes on mysql Pin
Gilbert Consellado8-Feb-16 3:02
professionalGilbert Consellado8-Feb-16 3:02 
Questiontextbox help Pin
Member 122873371-Feb-16 2:39
Member 122873371-Feb-16 2:39 
how are you all.
i am new to asp.net and c#. i need help.

well my question is, i have a textbox in which a user have to enter a float value in the webform.

and i want to manipulate that value in a calculation.
so have created a class for the calculation which is Sales class. in that class i have declared Price as a float value,the value which should be obtained from the textbox.ie public float Price {get;set;}

Now my problem is with binding/linking the Price variable with the textbox in the button_click method.

initially i had done it this way:

in my .aspx.cs file i have created an object of the class in this case :

Sales s = new Sales ();

protected void button_Click (object sender EventArgs e)

{
s.Price =Convert.ToInt32(Textbox1.Text);
s.Save();
}

i want the Price value to be saved in my database after a user clicks the SAVE button from the webform.

Now the problem is when i run the application there is an error (
C#
An exception of type 'System.NullReferenceException' occurred in Version1.dll but was not handled in user code
)
on the line :
s.Price = Convert.ToInt32(Textbox1.Text);

could i have done something wrong in the code?
AnswerRe: textbox help Pin
Chris Quinn1-Feb-16 4:10
Chris Quinn1-Feb-16 4:10 
GeneralRe: textbox help Pin
Member 122873371-Feb-16 20:19
Member 122873371-Feb-16 20:19 
AnswerRe: textbox help Pin
Sascha Lefèvre1-Feb-16 4:21
professionalSascha Lefèvre1-Feb-16 4:21 
GeneralRe: textbox help Pin
Jörgen Andersson1-Feb-16 21:15
professionalJörgen Andersson1-Feb-16 21:15 
GeneralRe: textbox help Pin
Sascha Lefèvre2-Feb-16 1:10
professionalSascha Lefèvre2-Feb-16 1:10 
GeneralRe: textbox help Pin
Jörgen Andersson2-Feb-16 1:30
professionalJörgen Andersson2-Feb-16 1:30 
GeneralRe: textbox help Pin
Sascha Lefèvre2-Feb-16 1:54
professionalSascha Lefèvre2-Feb-16 1:54 
AnswerRe: textbox help Pin
Richard MacCutchan1-Feb-16 22:00
mveRichard MacCutchan1-Feb-16 22:00 
Questionbinding a textbox Pin
Member 122873371-Feb-16 2:38
Member 122873371-Feb-16 2:38 
Questionstoring image in blob vs text? Pin
Jassim Rahma30-Jan-16 9:34
Jassim Rahma30-Jan-16 9:34 
AnswerRe: storing image in blob vs text? Pin
Mycroft Holmes30-Jan-16 12:36
professionalMycroft Holmes30-Jan-16 12:36 
GeneralRe: storing image in blob vs text? Pin
Eddy Vluggen30-Jan-16 23:40
professionalEddy Vluggen30-Jan-16 23:40 
AnswerRe: storing image in blob vs text? Pin
Eddy Vluggen30-Jan-16 23:39
professionalEddy Vluggen30-Jan-16 23:39 
AnswerRe: storing image in blob vs text? Pin
Jörgen Andersson30-Jan-16 23:57
professionalJörgen Andersson30-Jan-16 23:57 
QuestionSQL Server Query Plan Cache Behavior Pin
Foothill28-Jan-16 10:18
professionalFoothill28-Jan-16 10:18 
AnswerRe: SQL Server Query Plan Cache Behavior Pin
Jörgen Andersson29-Jan-16 3:49
professionalJörgen Andersson29-Jan-16 3:49 
GeneralRe: SQL Server Query Plan Cache Behavior Pin
Foothill29-Jan-16 4:14
professionalFoothill29-Jan-16 4:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.