.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
MarieAdela
Imran Ghani
Post New Web Links

Where Id

Posted By:      Posted Date: October 04, 2010    Points: 0   Category :ASP.Net
 

Hi All,

My code for fill dropdownlist:

//Delavci
            string Priimek = string.Empty;
            string Ime = string.Empty;
            string newName = string.Empty;

            connectionString.Open();
            string sqlStatement = "SELECT * from tbl_zaposleni;Select * from tbl_avtomobili";
            using (SqlCommand sqlCmd = new SqlCommand(sqlStatement, connectionString))
            {
                SqlDataReader sqlReader = sqlCmd.ExecuteReader();

                {
                    if (sqlReader.HasRows)
                    {
                        while (sqlReader.Read())
                        {
                            newName = string.Concat(sqlReader["Priimek"].ToString(), " ", sqlReader["Ime"].ToString());
                            ddlVoznik.Items.Add(new ListItem(newName));
                            ddlOdredil.Items.Add(new ListItem(newName));
                        }

                        sqlReader.NextResult();

                        if (sqlReader.HasRows)
                        {
                            while (sqlReader.Read())
                            {
                                newName = string.Concat(sqlReader["NazivVozila"].ToString(), " ", sqlReader["RegistrskaStevilka"].ToString(), " (&quo


View Complete Post


More Related Resource Links

Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend