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
natesh ghanta
NA
32
457
Please Reslove me from this error {"Cannot find table 0."}
Apr 4 2019 1:22 AM
protected
void
btnsubmit_Click(
object
sender, EventArgs e)
{
SqlConnection con =
new
SqlConnection(connectionString);
con.Open();
SqlCommand cmd =
new
SqlCommand(
"spGettblemployeeBydepartment"
, con);
cmd.Parameters.AddWithValue(
"@commandtype"
,
"insert"
);
int
employeeid = Convert.ToInt32(cmd.ExecuteNonQuery());
SqlDataAdapter sda =
new
SqlDataAdapter(cmd);
DataSet ds =
new
DataSet();
//TextBox CategoryID = (TextBox)GridView1.Rows[0].FindControl("txtemployeeid");
// cmd.Parameters.AddWithValue("employeeid", Convert.ToInt32(txtemployeeid));
cmd.Parameters.AddWithValue(
"@employeename"
, Convert.ToString(txtemployeename.Text.Trim()));
cmd.Parameters.AddWithValue(
"@departmentname"
, Convert.ToString(txtdepartmentname.Text.Trim()));
cmd.Parameters.AddWithValue(
"@employeeaddress"
, Convert.ToString(txtemployeeaddress.Text.Trim()));
//GridView1.DataSource = ds.Tables[1].DefaultView;
Bindgrid();
con.Close();
//GridView1.DataSource = ds;
//GridView1.DataBind();
// DataSet ds = new DataSet();
sda.Fill(ds);
GridView1.DataSource = ds;
//GridView1.DataMember = ds.Tables[0].TableName;
GridView1.DataSource = ds.Tables[0];
GridView1.DataBind();
}
Reply
Answers (
3
)
C# read() method - how to skip enter characters
datatable loop values into another datatable in c# ?