16,012,352 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 Javascript questions
View Visual Basic 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 Nowfer Rifkan (Top 17 by date)
Nowfer Rifkan
27-Nov-17 0:49am
View
it is independent of system's date format. if you want to make your own date when you run the application try this >>
dtpDate.Text = Convert.ToDateTime("22/11/2017").ToString();
Nowfer Rifkan
23-Aug-17 6:39am
View
dude,, change that values according to ur variable values,, date for date integer value for integer .. got?.. anyway the problem is in passing value .... i am replying while i am working on my project.. so hope u will find a solution,,,, if u cant let m e know i will reply u when i have time ,, good luck
Nowfer Rifkan
23-Aug-17 6:30am
View
it is a simple thing dude,, there should be a very small correction , without seeing it,,, we can only suggest... change the value according to ur variables (ex: string value, int valu) into that qutation and run the program it should save in the data base
try
{
using (SqlConnection conn = new SqlConnection(@"Data source = xxxx ; Database=xxxx; User Id=xxxx; Password=xxxx"))
{
conn.Open();
SqlCommand cmd = new SqlCommand("insert intoUXFaturas(TransDocument, TransSerial, TransDocNumber, Data, Estado) values('t', 't', 'tt', 'tt','tt')", conn);
cmd.ExecuteNonQuery();
conn.Close();
MessageBox.Show("inseriu");
}
}
catch (Exception ex)
{
throw ex;
}
Nowfer Rifkan
23-Aug-17 6:26am
View
u are keep running ur wrong code... just run the code i sent u....
Nowfer Rifkan
23-Aug-17 6:11am
View
put a breakpoint and run the program ... if u do not know how to put a break point and check please google it and find... so u can easily check that where u are stuck.... run the code which i sent u finally and see...
Nowfer Rifkan
23-Aug-17 6:07am
View
codes are perfect please check that ur values are passing ..... finally run this and check
try
{
using (SqlConnection conn = new SqlConnection(@"Data source = xxxx ; Database=xxxx; User Id=xxxx; Password=xxxx"))
{
conn.Open();
SqlCommand cmd = new SqlCommand("insert intoUXFaturas(TransDocument, TransSerial, TransDocNumber, Data, Estado) values('t', 't', 'tt', 'tt','tt')", conn);
cmd.ExecuteNonQuery();
conn.Close();
MessageBox.Show("inseriu");
}
}
catch (Exception ex)
{
throw ex;
}
Nowfer Rifkan
23-Aug-17 6:01am
View
try this . (copy past and run the code)
try
{
using (SqlConnection conn = new SqlConnection(@"Data source = xxxx ; Database=xxxx; User Id=xxxx; Password=xxxx"))
{
conn.Open();
SqlCommand cmd = new SqlCommand("insert intoUXFaturas(TransDocument, TransSerial, TransDocNumber, Data, Estado) values('" + _transaction.TransDocument + "', '" + _transaction.TransSerial + "', '" + _transaction.TransDocNumber + "', '" + data + "', '" + estado + "')", conn);
cmd.ExecuteNonQuery();
conn.Close();
MessageBox.Show("inseriu");
}
}
catch (Exception ex)
{
throw ex;
}
Nowfer Rifkan
23-Aug-17 5:54am
View
run this code and see, if it is work, then problem with ur values
try
{
using (SqlConnection conn = new SqlConnection(@"Data source = xxxx; Database=xxx; User Id=xxxx; Password=xxxx"))
{
conn.Open();
SqlCommand cmd = new SqlCommand(@"INSERT INTO UXFaturas(TransDocument, TransSerial, TransDocNumber, Data, Estado) VALUES (@transdocument, @transserial, @transdocnumber, @data, @estado)", conn);
cmd.Parameters.AddWithValue("@transdocument", "Test");
cmd.Parameters.AddWithValue("@transsarial", "0001");
cmd.Parameters.AddWithValue("@transdocnumber", "1010");
cmd.Parameters.AddWithValue("@data", "Test Data");
cmd.Parameters.AddWithValue("@estado", "testestado");
cmd.ExecuteNonQuery();
conn.Close();
MessageBox.Show("inseriu");
}
}
catch (Exception ex)
{
throw ex;
}
Nowfer Rifkan
23-Aug-17 5:50am
View
_transaction.TransDocument , _transaction.TransSerial, _transaction.TransDocNumber
ur variables with dot???? have u created these variables for textboxes??? if it is so dont create variables and give the controls name directly and check
Nowfer Rifkan
23-Aug-17 5:42am
View
then problem in execution.. did u put try catch? ok send me your code fully. fully means that saving part , i will check and let u know...
Nowfer Rifkan
23-Aug-17 5:32am
View
this is what my code also said.... if it is not still insert then.. please put a breakpoint and check ,, did the message box pop (what msg u have gave)????... and plz execute ur databas in server and see.. check these steps.....
Nowfer Rifkan
23-Aug-17 5:27am
View
Did you create
using System.Data.SqlClient;
if you cane please send me your code what you have written now....
Nowfer Rifkan
23-Aug-17 5:19am
View
send me your connection string
Nowfer Rifkan
23-Aug-17 5:13am
View
it will definitely work... if anything let us know.... good luck
Nowfer Rifkan
23-Aug-17 5:11am
View
for that u do not want to create message boxes put break point and check
use this code simply and try ... if u put try catch exception also it will show u the error
try
{
using (SqlConnection conn = new SqlConnection("Put ur connection string here"))
{
conn.Open();
SqlCommand cmd = new SqlCommand("insert into TableName(Column Ids) values('" + values + "')", conn);
cmd.ExecuteNonQuery();
conn.Close();
messagebox.show("Your message here");
}
}
catch (Exception ex)
{
throw ex;
}
Nowfer Rifkan
23-Aug-17 5:07am
View
Simply you use this code to insert the data into database
one more thing , create you connection string in global so you can call it whenever you want to use it.... if u write the connection string for all the parts then it won't be a healthy programming. anyway use this code to insert data simply into database
try
{
using (SqlConnection conn = new SqlConnection("Put ur connection string here"))
{
conn.Open();
SqlCommand cmd = new SqlCommand("insert into TableName(Column Ids) values('" + values + "')", conn);
cmd.ExecuteNonQuery();
conn.Close();
messagebox.show("Your message here");
}
}
catch (Exception ex)
{
throw ex;
}
Nowfer Rifkan
10-Aug-17 0:50am
View
Ozeki NG SMS Gateway Server is not running! plz help
Show More