Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 Why is this not working???

Author  Topic 

ML101
Starting Member

8 Posts

Posted - 2012-05-31 : 13:34:15
It's not working. not showing any error mistakes nothing! I tried using a label to see if it is even runing and it's not.
If anyone could help that would be AMAZING!
thanks

Transaction t1 = new Transaction();
//t.AccountId = 12
t1.AccountId = int.Parse(accountBoxWithdraw.Text);
t1.Amount = int.Parse(AmountBoxTakeOut.Text);
t1.Payee = PayeeBox2.Text;
t1.DatePosted = DateTime.Now;
string d = "Withdraw";
t1.CheckNum = 0;
//int accountid = 12;
int accountid = int.Parse(accountBoxWithdraw.Text);
SQLHelper sqlh3 = new SQLHelper();
string sql2 = "Insert INTO TransactionTB(DatePosted,Amount,Payee,CheckNumber,AccountId,Type)values('" + DateTime.Now + "'," + t1.Amount + ",'" + t1.Payee + "'," + t1.CheckNum + "," + t1.AccountId + ",'" + d + "')";
sqlh3.ExecuteNonQuery(sql2);


edit: moved to proper forum

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2012-05-31 : 13:38:24
Does it get to the execute statement? Have you checked the string that is being executed? Try running the profiler on the server to see if it trying to execute.

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

ML101
Starting Member

8 Posts

Posted - 2012-05-31 : 13:39:54
It does not get to the execute statement.
Any other options?
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2012-06-12 : 07:48:06
Athough this is late, thought I would add

..It it foes not get executed, what error message are you getting ?

I would encapsulate the statement in a try and catch block and parse the error message.

kind of looks like Entity Framework you are using ???
Go to Top of Page
   

- Advertisement -