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
sangeetha k
NA
207
51.6k
Cannot find table 0.
Sep 15 2017 2:16 AM
I am trying to auto generate id in the webpage it gives me cannot find table o(Index out of Range Exception)
Tell me where i am wrong and what i have to do
My databaselayer
public int generateid()
{
int id = 0;
DataSet ds = new DataSet();
string constring = null;
SqlConnection conn = null;
try
{
constring = ConfigurationManager.ConnectionStrings["MyConnection"].ConnectionString;
conn = new SqlConnection(constring);
conn.Open();
SqlCommand cmd = new SqlCommand("spAutoGeneratecustomerId1", conn);
cmd.CommandType = CommandType.StoredProcedure;
// SqldataAdapter da = new SqldataAdapter(cmd);
id = Convert.ToInt32(ds.Tables[0].Rows[0]["Customer_id"].ToString());
}
catch (Exception ex)
{
Console.WriteLine("Error" + ex.Message);
}
return id;
}
#business logic layer
public int getId()
{
int id;
id=dal.generateid();
return id;
}
#code behind
public partial class Test : System.Web.UI.Page
{
Business bal = new Business();
protected void Page_Load(object sender, EventArgs e)
{
txtId.Text = bal.getId().ToString();
}
Reply
Answers (
2
)
Issue in GridMvc.Html paging..
Check valid datetime in sql