Search Results

Search found 8 results on 1 pages for 'trntash'.

Page 1/1 | 1 

  • ComboBox.SelectionChanged doesn't catch the first selection

    - by trnTash
    I need to fill textboxes depending on the item selected in a combobox. I fill combo async and in Completed event I have the following code combo.ItemsSource = e.Result; combo.DisplayMemberPath = "Name"; combo.SelectedIndex = -1; Then in the SelectionChanged event of the combo, I catch the selected object MyClass mc= ((ComboBox)sender).SelectedItem as MyClass; tbxName.Text = mc.Name; ... However, when I load the project and select any event for the 1st time, NOTHING happens. Every other time (2nd, 3rd, nth) the data is correctly caught and displayed. So I need to know why the combo doesn't catch the first selection? That's the reason I have the code combo.SelectedIndex = -1 (when the app loads, combo is empty - selection -1 works).

    Read the article

  • What can map database tables like LINQ to SQL did?

    - by trnTash
    A good thing in LINQ to SQL was a fast and reliable way to map database tables and convert them into classes accessible from c# project. However it is no longer recommended to create projects using LINQ to SQL. What is its substitute? What kind of tool should I use in VS 2010 today if I want to have the same functionality as I had with LINQ to SQL?

    Read the article

  • System.Drawing.Image as source for asp.net image container

    - by trnTash
    I created image from byte array System.Drawing.Image newImage; using (MemoryStream ms = new MemoryStream(imageBytes, 0, imageBytes.Length)) { ms.Write(imageBytes, 0, imageBytes.Length); newImage = System.Drawing.Image.FromStream(ms, true); } and now I need to have this image as a source for asp:Image (System.Web.UI.WebControls.Image). Is this possible as I know that conversion is impossible?

    Read the article

  • Server.Transfer does not work?

    - by trnTash
    I want to redirect to another page using Server.Transfer and I have this simple code: if (Page.IsPostBack) { try { Server.Transfer("AnotherPage.aspx"); } catch (Exception) { throw ; } } But I'm getting an error: "Error executing child request for AnotherPage.aspx.". Could not find the solution on the net. Just to mention, Response.Redirect works flawlessly.

    Read the article

  • LINQ - more than or equal to

    - by trnTash
    Part of the code: ...where se.DateFrom >= pDateFrom && se.DateTo <= pDateTo select se... Does not work. There is no any error but the To and From days do not get returned. How do I query "more than or equal to" and "less than or equal to"? Thanks :)

    Read the article

  • Drop all foreign keys in a table

    - by trnTash
    I had this script which worked in sql server 2005 -- t-sql scriptlet to drop all constraints on a table DECLARE @database nvarchar(50) DECLARE @table nvarchar(50) set @database = 'dotnetnuke' set @table = 'tabs' DECLARE @sql nvarchar(255) WHILE EXISTS(select * from INFORMATION_SCHEMA.TABLE_CONSTRAINTS where constraint_catalog = @database and table_name = @table) BEGIN select @sql = 'ALTER TABLE ' + @table + ' DROP CONSTRAINT ' + CONSTRAINT_NAME from INFORMATION_SCHEMA.TABLE_CONSTRAINTS where constraint_catalog = @database and table_name = @table exec sp_executesql @sql END It does not work in SQL Server 2008. How can I easily drop all foreign key constraints for a certain table? Does anyone have a better script?

    Read the article

1