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
Mayur Gujrathi
NA
119
403.3k
To generate 1+ value in combobox from a integer column of sql server
Nov 13 2010 2:31 AM
Dear Friends I have to generate 1+ value from maximum available in column of table for that I have one stored procedure As shown below
ALTER procedure generateid
as
begin
select max("pid")+1 from pinfo
end
And in datalayer i have called it in this way
public DataSet generateid()
{
con = new SqlConnection("integrated security=true;database=hm");
cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "generateid";
da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds, "pinfo");
return ds;
}
and from front end I have tried to get value in following way
DL gi = new DL();
DataSet ds = gi.generateid ();
comboBox1 .DataSource = ds.Tables["pinfo"] ;
comboBox1 .DisplayMember = "pid";
but it is coming as System.Data.DataRowView
please suggest me solution
Reply
Answers (
1
)
Choosing a label at random
Handle exception of crystal report