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
Israel
698
1.3k
217.7k
deleting and filtering
Jul 19 2013 4:37 AM
Hi!
These lines of codes work well. Its saving only! Then I would like to learn how to do two things:
1. How to delete rows?
2. How to filter a data from a TextBox?
Following the logic of my codes please (for example, Protected void Delete_Click and Protected void TxtBoxFilter_Click)
Protected void
Save_Click(
Object
sender,
EventArgs
e)
{
string
strcon = "Data Source=localhost\\sqlexpress;Inital Catalog=Mfwamba;Integrated Security=True";
SqlConnection
con
new
SqlConnection(strcon);
SqlCommand
com =
new
SqlCommand
(
"save123"
, con);
com.CommandType =
CommandType
.StoreProcedure;
SqlParameter
p1 = new SqlParameter(
"FirstName"
,txtfirstname.Text);
SqlParameter
p2 = new SqlParameter(
"LastName"
,txtlastname.Text);
com.Parameters.Add(p1);
com.Parameters.Add(p2);
con.Open();
com.ExecteNonQuery();
labelinfo.Text =
"Registered successfull."
;
}
Protected void
Delete_Click(
Object
sender,
EventArgs
e)
{
// ???
}
}
Protected void
TxtBoxFilter_Click(
Object
sender,
EventArgs
e)
{
// ???
}
}
Reply
Answers (
11
)
Why to use Data Table in C#?
Filling a combobox