Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static int getdistrictid(string okres)
- {
- int id;
- string dname = okres;
- string cstring = Properties.Settings.Default.volbydbConnectionString;
- SqlConnection sqlpripojeni = new SqlConnection(cstring);
- SqlCommand getrid = new SqlCommand("SELECT DistrictId FROM Districts WHERE Name= @Districtname", sqlpripojeni);
- getrid.Parameters.Add(new SqlParameter("@Districtname", dname));
- sqlpripojeni.Open();
- id = Convert.ToInt32(getrid.ExecuteScalar());
- sqlpripojeni.Close();
- return id;
- }
- //pokazde vrati 0
- //pokud se dname nahradi konkretnim vyrazim funguje spravne
- //dname ma spatne kodovani?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement