Click here to Skip to main content
15,886,137 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Code i am using-
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Data;
using System.Data.SqlClient;
using System.Web.UI.WebControls;
using Fobbs.Logic;
using System.Globalization;
using System.Threading.Tasks;

namespace Fobbs
{
    public partial class Eng1 : System.Web.UI.Page
    {

        IndexLogic il = new IndexLogic();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Aieebind();   
            }
        }

        void Aieebind()
        {
            DataSet ds = new DataSet();
            ds = il.FetchData(1);
            DDLAieee.DataSource = ds.Tables[0];
            DDLAieee.DataBind();
            DDLAieee.Items.Insert(0, new ListItem("Select", "Select"));
        }


        protected void DDLAieee_SelectedIndexChanged(object sender, EventArgs e)
        {
            DataSet ds = new DataSet();
            ds = il.FetchDataById(2, Convert.ToInt32(DDLAieee.SelectedItem.Text));
            if (ds.Tables[0].Rows.Count > 0)
            {
                txtdescription.Text = ds.Tables[0].Rows[0][1].ToString();
                
            }
        }
    }
}

pls reply me soon...

[Edit member="Tadit"]
Added pre tags.
Added new Tags.
[/Edit]
Posted
v3
Comments
Murugesan22 29-Apr-14 5:35am    
plz post source
Murugesan22 29-Apr-14 5:37am    
please check dropdownlist autopostback=true property
ADI@345 29-Apr-14 5:43am    
sir,autopostback property was not true,but after we do true,then error comes:
DataSet ds = new DataSet();
Line 39: ds = il.FetchDataById(2, Convert.ToInt32(DDLAieee.SelectedItem.Text));
Line 40: if (ds.Tables[0].Rows.Count > 0)
Line 41: {
Line 42: txtdescription.Text = ds.Tables[0].Rows[0][1].ToString();
Nelek 29-Apr-14 6:15am    
Get used to Edit the question to add your code snippets there and don't post it in comments. In the question you can use the code tags, tabulation and many other tools. Here is much more difficult for us to read.
ADI@345 29-Apr-14 6:09am    
Input string was not in a correct format.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.FormatException: Input string was not in a correct format.

Source Error:


Line 37: {
Line 38: DataSet ds = new DataSet();
Line 39: ds = il.FetchDataById(2, Convert.ToInt32(DDLAieee.SelectedItem.Text));
Line 40: if (ds.Tables[0].Rows.Count > 0)
Line 41: {


Source File: C:\Users\ADI\Documents\Visual Studio 2010\Projects\Fobbs\Fobbs\Eng1.aspx.cs Line: 39

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900