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
Richa Chunekar
NA
6
454
Store procedure
Apr 17 2018 7:36 AM
i have made a function in class file to call store procedure to fatch data from data base, the function is written below.
public DataTable odrsrch()
{
using (SqlConnection connection = new SqlConnection(GetConnectionString()))
{
connection.Open();
SqlCommand com = new SqlCommand("ordersp", connection);
com.CommandType = CommandType.StoredProcedure;
SqlDataAdapter adp = new SqlDataAdapter(com);
DataSet ds = new DataSet();
adp.Fill(ds, "ordersp");
connection.Close();
return ds.Tables[0];
}
}
and at button i have called the mathed using class object, but i am not getting result.
protected void btnsrch_Click(object sender, EventArgs e)
{
ordercls oc = new ordercls();
string srch = Convert.ToString(txtsrch.Text).Trim();
DataTable objdt = oc.odrsrch();
gv.DataSource = objdt;
gv.DataBind();
}
Reply
Answers (
2
)
download large excel file from ASP MVC application
Multi Resolution Concept