15,917,709 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 Python 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 Mustafa77 (Top 11 by date)
Mustafa77
7-Feb-15 2:42am
View
Thank you my friend i'll try that, then i'll tell you again
Mustafa77
1-Oct-14 9:11am
View
My friend can you give me complete example about how itextSharp.dll and PdfStamper class use to use watermark in pdf file...and thanks so much.
Mustafa77
1-Oct-14 9:08am
View
there are many links but i can not find the right library(free) .dll for my problem, my problem is how i can place a watermark (which is number 1..2..3 etc) which is written dynamically on the pdf file through create of pdf files
Mustafa77
5-Sep-14 9:02am
View
oki, sorry for that my friend about that
Mustafa77
5-Sep-14 8:04am
View
I am using Visual Studio 2012, Please any one help me
connectionString="Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\dbupdate.mdf;Integrated Security=True"
Mustafa77
5-Sep-14 5:02am
View
My friend i try that (id= + dataGridView1.Rows[k].Cells[].....) before, i placed id=1 just only to see if that changing is reflect in the database, nothing was happened in the database...
My friend i think that simple but i cannot to see where is the error in my code....
thank you again to see my problem
Mustafa77
5-Sep-14 4:43am
View
the connection string in App.config is:
<add name="test_update.Properties.Settings.dbupdateConnectionString"
="" connectionstring="Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\dbupdate.mdf;Integrated Security=True" providername="System.Data.SqlClient">
Mustafa77
5-Sep-14 4:14am
View
<connectionstrings>
<add name="test_update.Properties.Settings.dbupdateConnectionString" connectionstring="Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\dbupdate.mdf;Integrated Security=True" providername="System.Data.SqlClient">
in app.Config
no there any problem in it
the problem is the changing was happened in the gridview but that no reflects on the database
Mustafa77
5-Sep-14 4:13am
View
Deleted
<connectionstrings>
<add name="test_update.Properties.Settings.dbupdateConnectionString"
="" connectionstring="Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\dbupdate.mdf;Integrated Security=True" providername="System.Data.SqlClient">
in app.Config
no there any problem in it
the problem is the changing was happened in the gridview but that no reflects on the database
Mustafa77
5-Sep-14 2:32am
View
Oki my friend, my code in windows form as:
public partial class Form1 : Form
{
SqlConnection con;
SqlDataAdapter adap;
DataSet ds;
SqlCommandBuilder scb;
SqlCommand scmd;
public Form1()
{
InitializeComponent();
load_student();
}
private void load_student()
{
try
{
con = new SqlConnection();
con.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["test_update.Properties.Settings.dbupdateConnectionString"].ConnectionString; ;
con.Open();
string sql = "select * from student";
adap = new SqlDataAdapter(sql, con);
ds = new System.Data.DataSet();
adap.Fill(ds, "student");
dataGridView1.DataSource = ds.Tables[0];
}
catch (Exception ex)
{
MessageBox.Show("Error! " + ex.Message);
}
finally
{
con.Close();
}
}
private void update_btn_Click(object sender, EventArgs e)
{
try
{
/*scb = new SqlCommandBuilder(adap);
adap.Update(ds, "student");*/
string sql = "update student set name='ali' where id=2";
scmd = new SqlCommand(sql, con);
con.Open();
scmd.ExecuteNonQuery();
MessageBox.Show("Updating is had been successfully");
}
catch (Exception ex)
{
MessageBox.Show("Error " + ex.Message);
}
finally
{
con.Close();
scb = new SqlCommandBuilder(adap);
adap.UpdateCommand = scmd;
adap.Update(ds, "student");
ds.AcceptChanges();
load_student();
}
}
private void button1_Click(object sender, EventArgs e)
{
con = new SqlConnection();
con.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["test_update.Properties.Settings.dbupdateConnectionString"].ConnectionString; ;
string sql1 = "delete from student where id=1";
scmd = new SqlCommand(sql1, con);
try
{
con.Open();
scmd.ExecuteNonQuery();
MessageBox.Show("Successfully deleting");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
con.Close();
load_student();
}
}
}
I am waiting your helping my friend, there are any errors in code
Mustafa77
5-Sep-14 2:23am
View
Deleted
private void load_student()
{
try
{
con = new SqlConnection();
con.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["test_update.Properties.Settings.dbupdateConnectionString"].ConnectionString; ;
con.Open();
string sql = "select * from student";
adap = new SqlDataAdapter(sql, con);
ds = new System.Data.DataSet();
adap.Fill(ds, "student");
dataGridView1.DataSource = ds.Tables[0];
}
catch (Exception ex)
{
MessageBox.Show("Error! " + ex.Message);
}
finally
{
con.Close();
}
}
private void update_btn_Click(object sender, EventArgs e)
{
try
{
/*scb = new SqlCommandBuilder(adap);
adap.Update(ds, "student");*/
string sql = "update student set name='ali' where id=2";
scmd = new SqlCommand(sql, con);
con.Open();
scmd.ExecuteNonQuery();
MessageBox.Show("Updating is had been successfully");
}
catch (Exception ex)
{
MessageBox.Show("Error " + ex.Message);
}
finally
{
con.Close();
scb = new SqlCommandBuilder(adap);
adap.UpdateCommand = scmd;
adap.Update(ds, "student");
ds.AcceptChanges();
load_student();
}
}
private void button1_Click(object sender, EventArgs e)
{
con = new SqlConnection();
con.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["test_update.Properties.Settings.dbupdateConnectionString"].ConnectionString; ;
string sql1 = "delete from student where id=1";
scmd = new SqlCommand(sql1, con);
try
{
con.Open();
scmd.ExecuteNonQuery();
MessageBox.Show("Successfully deleting");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
con.Close();
load_student();
}
}
I wish help my friend, and thanks about your helping
Show More