TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
ClonecMr cool
NA
34
18.7k
cmd.executeNonQuery ??
Jun 10 2011 11:09 PM
Hello,
can some body tell me,
what the best methode to delete row without dataset and data table ?
and than the result of deleted row can show into text box.
---snip---
private void btnptong_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Ente Yakin Gan ?", "Konfirmasi Hapus Data", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes )
{
// proceed with deletion
NpgsqlConnection conn = new NpgsqlConnection(connstr);
NpgsqlCommand cmds = conn.CreateCommand();
cmds.CommandText =
"DELETE FROM smsinbox WHERE timereceived < '" + dateTimePicker1.Text + "';" +
"DELETE FROM smsoutbox WHERE timesent < '" + dateTimePicker1.Text + "';" +
"DELETE FROM customer WHERE transactiontime < '" + dateTimePicker1.Text + "';";
conn.Open();
if (conn.State == ConnectionState.Open)
{
cmds.ExecuteNonQuery();
}
else
{
MessageBox.Show("Error");
}
conn.Close();
}
}
--- end snip ----
It's working, with no information result.
No message like "Query returned successfully: 100 rows affected, 302 ms execution time." to shown.
So I'm not know the job has been finished or not.
I'm Not Sure it's true way ...
any suggestion will be appreciated :)
Reply
Answers (
5
)
How to get Date from User
Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.