How to add additional text from other tables in drop down list [Resolved]

Posted by Pkanwar under ASP.NET on 3/9/2013 | Points: 10 | Views : 2194 | Status : [Member] | Replies : 2
Hi ,
We have a country table, which have country code and country name, these country names have been shown in drop down list. Now We have added another table, which have same country code and another country name:

For example: 1 Table have Countrycode: 1, CountryName: India - It has been shown in DropDown List:
2. Table have same country Code:1, CountryName: Indian:

OutPut is: In drop- down list: should be shown: India and Indian also, If we enter name in second table.



Thanks




Responses

Posted by: Pkanwar on: 3/9/2013 [Member] Starter | Points: 25

Up
0
Down
Thanks, This code is very Helpful...
Keep it up :)..
Happy Coding...

Pkanwar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Pkanwar on: 3/9/2013 [Member] Starter | Points: 25

Up
0
Down
Here I have added ListViewControll, But when I read data in ListView Controll. error shows have some invalid arguments. Please let me aware, where I am going to wrong.

try
{
SqlConnection con = new SqlConnection();
con.ConnectionString = CountryInfoProvider.StudentConnect;
con.Open();
SqlCommand sqlcmd = new SqlCommand();
sqlcmd.Connection = con;
sqlcmd.CommandText = "countryNew";
sqlcmd.CommandType = CommandType.StoredProcedure;
sqlcmd.Parameters.AddWithValue("@language", language.ToString());
SqlDataReader reader1 = sqlcmd.ExecuteReader();
while (reader1.Read())
{
dlvCountry.Items.Add(reader1["CountryName"].ToString()); This line error shows: have some invalid argument
}
reader1.Close();
con.Close();
}
catch (Exception)
{
throw;
}

Thanks

Pkanwar, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response