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

Post New Web Links

How to add sql

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

 DataTable dt = new DataTable();
            string Priimek = string.Empty;
            string Ime = string.Empty;
            string newName = string.Empty;

            string NazivVozila = string.Empty;
            string RegistrskaStevilka = string.Empty;
            string TipVozila = string.Empty;

            SqlConnection connection = new SqlConnection("Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\ASPNETDB.MDF;Integrated Security=True;User Instance=True");


                string sqlStatement = "SELECT tbl_zaposleni*, tbl_avtomobili.* FROM  tbl_zaposleni INNER JOIN tbl_avtomobili";
                SqlCommand sqlCmd = new SqlCommand(sqlStatement, connection);
                SqlDataAdapter sqlDa = new SqlDataAdapter(sqlCmd);
                if (dt.Rows.Count > 0)
                    for (int i = 0; i < dt.Rows.Count; i++)
                        Priimek = dt.Rows[i]["Priimek"].ToString();
                        Ime = dt.Rows[i]["Ime"].ToString();
                        newName = Priimek + " " + Ime;
                        DropDownList1.Items.Add(new ListItem(newName));
                     //   DropDownList3

View Complete Post

More Related Resource Links

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