Dictionary<string, string> openWith = new Dictionary<string, string>(); // Add some elements to the dictionary. There are no // duplicate keys, but some of the values are duplicates. openWith.Add("txt", "notepad.exe"); openWith.Add("bmp", "paint.exe"); openWith.Add("dib", "paint.exe"); openWith.Add("rtf", "wordpad.exe"); DDL.DataSource = openWith .Select(r => new KeyValuePair<string, string>(r.Key, r.Value)) .ToList(); DDL.DataTextField = "Key"; DDL.DataValueField = "Value"; DDL.DataBind();
world wide web development problems asp net php html xhtml css javascript jquery w3dproblems
Monday, September 8, 2014
Bind a Dictionary to a DropDownList
call change() event handler if I select radio button programatically
$(function () {
$('input[name=type]').change(function () { alert($(this).val()); }); $('input[value=SV]').attr('checked', 'checked').trigger('change'); });
Saturday, September 6, 2014
EF5: Cannot attach the file ‘{0}' as database '{1}'
Go to View -> SQL Server Object Explorer and delete the database from the (localdb)\v11.0 subnode!
Delete the database
Delete the database
The model backing the context has changed since the database was created
Database.SetInitializer<YourDbContext>(null);
or
for later versionsDatabase.SetInitializer(new DropCreateDatabaseIfModelChanges<YourDbContext>());
Wednesday, August 27, 2014
Computed Columns and CASE SQL Server
CASE WHEN shipdate is NULL AND orderdate < DATEADD( dd, -7, GETDATE()) THEN 3 WHEN shipdate is NOT NULL THEN 2 ELSE 1 END
Subscribe to:
Comments (Atom)