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
Bineesh Viswanath
NA
1k
780.6k
ASP.NET DataGridView Fill Method
Aug 23 2013 5:07 AM
Sir, I need your help in GridView Fill Method.
I not need any tutorial links. Here I posting my code as output.
Here I showing the output . Check the code for this below. This is getting in the btnSave_Click Event(see code below).
divisionId,divisionName and ClassName is not retrieving.
SQL Stored procedure:-
ALTER PROCEDURE divisionViewAll
AS
SELECT divisionId, divisionName, tbl_Class.className
FROM tbl_Division
Inner join tbl_Class
ON tbl_Division.classId=tbl_Class.classId
ORDER BY className
DivisionSP.cs:-
public DataTable DivisionViewAll()
{
DataTable d = new DataTable();
SqlDataAdapter a = new SqlDataAdapter("divisionViewAll", sqlCon);
a.SelectCommand.CommandType = CommandType.StoredProcedure;
a.Fill(d);
return d;
}
Division.aspx.cs :-
public void gridFill()
{
DataTable d = new DataTable();
divisionSP spDiv = new divisionSP();
d = spDiv.DivisionViewAll();
dgvDivision.DataSource = d;
dgvDivision.DataBind();
}
btnSave_Click:-
protected void btnSave_Click(object sender, EventArgs e)
{
divisionSP spDiv = new divisionSP();
divisionInfo InfoDiv = new divisionInfo();
InfoDiv.divisionName = txtDivision.Text;
InfoDiv.classId = decimal.Parse(cmbClassName.SelectedValue.ToString());
spDiv.DivisionAdd(InfoDiv);
mvDivision.ActiveViewIndex = 1;
gridFill();
}
My save function is working.
There is Two <asp:View> . grid is in 2nd View and Save function is in 1st.
help me in this topic.
Reply
Answers (
11
)
In some pc in browser ie9 while uploading jpg file ...
multicolumn search in single Textbox. c#asp.net