16,020,622 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Visual Basic questions
View Javascript questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by stefanere2k9 (Top 12 by date)
stefanere2k9
18-Mar-12 21:28pm
View
i have got this code now but it dont seem to be working;
SqlDataReader readdata;
sqlCommandWithdraw.Connection.Open();
decimal balance = decimal.Parse(Txt_Withdraw.Text);
decimal availableTBalance = 0.00M;
sqlCommandWithdraw.Parameters["@accountID"].Value = showaccounts.accountID;
readdata = sqlCommandWithdraw.ExecuteReader();
while (readdata.Read())
{
availableTBalance = (Convert.ToDecimal(readdata["balance"].ToString()) + Convert.ToDecimal(readdata["overdraftlimit"]));
}
sqlCommandWithdraw.Connection.Close();
if (availableTBalance >= balance)
{
sqlCommandUpdateBalance.Connection.Open();
availableTBalance -= balance;
sqlCommandUpdateBalance.Parameters["@balance"].Value = availableTBalance;
sqlCommandUpdateBalance.Parameters["@accountID"].Value = showaccounts.accountID;
sqlCommandUpdateBalance.ExecuteNonQuery();
sqlCommandUpdateBalance.Connection.Close();
stefanere2k9
14-Mar-12 11:56am
View
winforms and logtableadapter1 is a dataadapter which contains the table
stefanere2k9
13-Mar-12 19:33pm
View
WinForms
stefanere2k9
9-Mar-12 14:54pm
View
on the table i got ID, cardNumber, amount, date. i only want to display the cardnumber that i have passed from form1. am not sure how to do this as i havent worked with datagrid before
stefanere2k9
7-Mar-12 15:59pm
View
sorry for wasting your time i was passing the wrong data over. Now it working fine. what i need to do aswell i want to display available balance where balance + overdraftLimit how would i do that
stefanere2k9
7-Mar-12 15:08pm
View
_cardNumber is the value from the previous form
stefanere2k9
7-Mar-12 13:53pm
View
managed to get most of the code working now
SqlDataReader readdata;
{
sqlCommandbalance.Connection.Open();
sqlCommandbalance.Parameters["@accountID"].Value = _cardNumber;
readdata = sqlCommandbalance.ExecuteReader();
string balanceDB = null;
while (readdata.Read())
{
balanceDB = readdata["balance"].ToString();
}
sqlCommandbalance.Connection.Close();
sqlCommandbalance.Dispose();
balanceShow.Text += " " + balanceDB.ToString();
}
on the last line balanceShow.Text += " " + balanceDB.ToString(); i got a error saying Object reference not set to an instance of an object.
stefanere2k9
1-Mar-12 15:29pm
View
is this correct?
Dictionary<string, int=""> attemptsmade = new Dictionary<string, int="">();
if (!attemptsmade.ContainsKey("cardNumber"))
{
attemptsmade.Add("1234", 3);
attemptsmade.Add("3455", 3);
attemptsmade.Add("4343", 3);
attemptsmade.Add("4432", 3);
attemptsmade.Add("5454", 3);
}
would i stay be able to do the messagebox the same way?
stefanere2k9
1-Mar-12 12:33pm
View
could i use an array here
such as int[] attempts = new new[5]
{
not quite sure how to call stuff from database?
]
stefanere2k9
24-Feb-12 12:48pm
View
on this line of code - readdata = sqlCommandCheckBalance.ExecuteReader();
cannot convert parameter from string to int32... how would i convert it try a few things but nothing working
stefanere2k9
24-Feb-12 12:41pm
View
like this? sqlCommandCheckBalance.Parameters["accountID"].Value = balanceShow.Text;
stefanere2k9
22-Feb-12 17:48pm
View
what if the username are all in the database? or would i still have to put indivdual usernames in that piece of code?
Show More