Search Results

Search found 1919 results on 77 pages for 'semantic markup'.

Page 45/77 | < Previous Page | 41 42 43 44 45 46 47 48 49 50 51 52  | Next Page >

  • Trouble updating my datagrid in WPF

    - by wrigley06
    As the title indicates, I'm having trouble updating a datagrid in WPF. Basically what I'm trying to accomplish is a datagrid, that is connected to a SQL Server database, that updates automatically once a user enters information into a few textboxes and clicks a submit button. You'll notice that I have a command that joins two tables. The data from the Quote_Data table will be inserted by a different user at a later time. For now my only concern is getting the information from the textboxes and into the General_Info table, and from there into my datagrid. The code, which I'll include below compiles fine, but when I hit the submit button, nothing happens. This is the first application I've ever built working with a SQL Database so many of these concepts are new to me, which is why you'll probably look at my code and wonder what is he thinking. public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } public DataSet mds; // main data set (mds) private void Window_Loaded_1(object sender, RoutedEventArgs e) { try { string connectionString = Sqtm.Properties.Settings.Default.SqtmDbConnectionString; using (SqlConnection connection = new SqlConnection(connectionString)) { connection.Open(); //Merging tables General_Info and Quote_Data SqlCommand cmd = new SqlCommand("SELECT General_Info.Quote_ID, General_Info.Open_Quote, General_Info.Customer_Name," + "General_Info.OEM_Name, General_Info.Qty, General_Info.Quote_Num, General_Info.Fab_Drawing_Num, " + "General_Info.Rfq_Num, General_Info.Rev_Num, Quote_Data.MOA, Quote_Data.MOQ, " + "Quote_Data.Markup, Quote_Data.FOB, Quote_Data.Shipping_Method, Quote_Data.Freight, " + "Quote_Data.Vendor_Price, Unit_Price, Quote_Data.Difference, Quote_Data.Vendor_NRE_ET, " + "Quote_Data.NRE, Quote_Data.ET, Quote_Data.STI_NET, Quote_Data.Mfg_Time, Quote_Data.Delivery_Time, " + "Quote_Data.Mfg_Name, Quote_Data.Mfg_Location " + "FROM General_Info INNER JOIN dbo.Quote_Data ON General_Info.Quote_ID = Quote_Data.Quote_ID", connection); SqlDataAdapter da = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); da.Fill(dt); MainGrid.ItemsSource = dt.DefaultView; mds = new DataSet(); da.Fill(mds, "General_Info"); MainGrid.DataContext = mds.Tables["General_Info"]; } } catch (Exception ex) { MessageBox.Show(ex.Message); } // renaming column names from the database so they are easier to read in the datagrid MainGrid.Columns[0].Header = "#"; MainGrid.Columns[1].Header = "Date"; MainGrid.Columns[2].Header = "Customer"; MainGrid.Columns[3].Header = "OEM"; MainGrid.Columns[4].Header = "Qty"; MainGrid.Columns[5].Header = "Quote Number"; MainGrid.Columns[6].Header = "Fab Drawing Num"; MainGrid.Columns[7].Header = "RFQ Number"; MainGrid.Columns[8].Header = "Rev Number"; MainGrid.Columns[9].Header = "MOA"; MainGrid.Columns[10].Header = "MOQ"; MainGrid.Columns[11].Header = "Markup"; MainGrid.Columns[12].Header = "FOB"; MainGrid.Columns[13].Header = "Shipping"; MainGrid.Columns[14].Header = "Freight"; MainGrid.Columns[15].Header = "Vendor Price"; MainGrid.Columns[16].Header = "Unit Price"; MainGrid.Columns[17].Header = "Difference"; MainGrid.Columns[18].Header = "Vendor NRE/ET"; MainGrid.Columns[19].Header = "NRE"; MainGrid.Columns[20].Header = "ET"; MainGrid.Columns[21].Header = "STINET"; MainGrid.Columns[22].Header = "Mfg. Time"; MainGrid.Columns[23].Header = "Delivery Time"; MainGrid.Columns[24].Header = "Manufacturer"; MainGrid.Columns[25].Header = "Mfg. Location"; } private void submitQuotebtn_Click(object sender, RoutedEventArgs e) { CustomerData newQuote = new CustomerData(); int quantity; quantity = Convert.ToInt32(quantityTxt.Text); string theDate = System.DateTime.Today.Date.ToString("d"); newQuote.OpenQuote = theDate; newQuote.CustomerName = customerNameTxt.Text; newQuote.OEMName = oemNameTxt.Text; newQuote.Qty = quantity; newQuote.QuoteNumber = quoteNumberTxt.Text; newQuote.FdNumber = fabDrawingNumberTxt.Text; newQuote.RfqNumber = rfqNumberTxt.Text; newQuote.RevNumber = revNumberTxt.Text; try { string insertConString = Sqtm.Properties.Settings.Default.SqtmDbConnectionString; using (SqlConnection insertConnection = new SqlConnection(insertConString)) { insertConnection.Open(); SqlDataAdapter adapter = new SqlDataAdapter(Sqtm.Properties.Settings.Default.SqtmDbConnectionString, insertConnection); SqlCommand updateCmd = new SqlCommand("UPDATE General_Info " + "Quote_ID = @Quote_ID, " + "Open_Quote = @Open_Quote, " + "OEM_Name = @OEM_Name, " + "Qty = @Qty, " + "Quote_Num = @Quote_Num, " + "Fab_Drawing_Num = @Fab_Drawing_Num, " + "Rfq_Num = @Rfq_Num, " + "Rev_Num = @Rev_Num " + "WHERE Quote_ID = @Quote_ID"); updateCmd.Connection = insertConnection; System.Data.SqlClient.SqlParameterCollection param = updateCmd.Parameters; // // Add new SqlParameters to the command. // param.AddWithValue("Open_Quote", newQuote.OpenQuote); param.AddWithValue("Customer_Name", newQuote.CustomerName); param.AddWithValue("OEM_Name", newQuote.OEMName); param.AddWithValue("Qty", newQuote.Qty); param.AddWithValue("Quote_Num", newQuote.QuoteNumber); param.AddWithValue("Fab_Drawing_Num", newQuote.FdNumber); param.AddWithValue("Rfq_Num", newQuote.RfqNumber); param.AddWithValue("Rev_Num", newQuote.RevNumber); adapter.UpdateCommand = updateCmd; adapter.Update(mds.Tables[0]); mds.AcceptChanges(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } } Thanks in advance to anyone who can help, I really appreciate it, Andrew

    Read the article

  • Run WPF Application from another assembly

    - by Ricibald
    I want to run my wpf application "A" from another assembly "B". I use the following code: static void main() { var app = new A.App(); app.InitializeComponent(); app.Run(); } when i run my app I got the following error: Cannot convert string '/Resources/icon.gif' in attribute 'Icon' to object of type 'System.Windows.Media.ImageSource'. Cannot locate resource 'resources/icon.gif'. Error at object 'MainWindow' in markup file 'A;component/shell/shellview.xaml'. How can I transfer from B images and resources info to A? Thanks!

    Read the article

  • CMS template creation and jQuery integration

    - by Fermin
    Hi, First off I should say that I don't have any experience in working with a CMS. I have 2 general questions about CMS: How easy is it to create a template? I have strong CSS/XHTML skills, is creating a template as easy as writing the markup or does it have to be done in a very rigid way? How is jQuery support in CMS systems? I like what you can do with jQuery and would like to incorporate it into the next couple of sites that I will do. EDIT: So far answers are asking which CMS, I don't have any in mind. Any suggestions welcome, open source and non .NET preferable.

    Read the article

  • jQuery plugin, return value from function

    - by Marius
    Hello there, Markup: <input type="text" name="email" /> Code: $(':text').focusout(function(){ $(this).validate(function(){ $(this).attr('name'); }); }); Plugin: (function($){ $.fn.validate = function(type) { return this.each(function(type) { if (type == 'email') { matches = this.val().match('/.+@.+\..{2,7}/'); (matches != null) ? alert('valid') : alert('invalid'); } /*else if (type == 'name') { } else if (type == 'age') { } else if (type == 'text') { }*/ else { alert('total failure'); } }); }; })(jQuery); The problem is that when I execute the code above, it runs the plugin as if type was a string: "function(){ $(this).attr('name'); });" instead of executing it as a function. How do I solve this? Thank you for your time. Kind regards, Marius

    Read the article

  • Will more CPUs/cores help with VS.NET build times?

    - by LoveMeSomeCode
    I was wondering if anyone knew whether Visual Studio .NET had a parallel build process or not? I have a solution with lots of projects, every project has lots of markup/code, lots of types, etc. Just sitting there with intellisense on runs it up to about 700MB. But the build times are really slow and only seem to max out one of my two cpu cores. Does this mean the build process is single threaded? My solution's build dependency chain isn't linear, so I don't see why it couldn't be building some of the projects in parallel. I remember Joel Spolsky blogging about his new SSD, and how it didn't help with compile times, but he didn't mention which compiler he was using. We're using VS 2005. Anyone know how it's compilation works? And is it any different/better in 2008/2010?

    Read the article

  • Performance differences between iframe hiding methods?

    - by Ender
    Is there a major performance difference between the following: <iframe style="visibility:hidden" /> <iframe style="width:0px; height:0px; border:0px" /> I'm using a hidden iframe to pull down and parse some information from an external server. If the iframe actually attempts to render the page, this may suck up a lot of CPU cycles. Of course, I'd ideally just want to get the raw markup - for example, if I could prevent the iframe from loading img tags, that would be perfect.

    Read the article

  • WPF Binding XAML vs C#

    - by kubal5003
    Hello, I've got a strange problem - binding created through XAML (both ways by markup extension or normal) isn't working(BindingOperations.IsDataBound returns false and in fact there is no Binding object created). When I do literally the same from code everything is working perfectly. One more thing is that the Binding in XAML is created in a DataTemplate - what's funny about that when I use the DataTemplate for the first time it fails, then I fix it from code (add binding to specific objects) and while adding more objects to the collection the binding set in XAML just works. If I try to remove all the objects from the collection and then add a new one the binding fails once again. In reality this is a shortened version of another of my questions. For details please refer to: http://stackoverflow.com/questions/2986511/wpf-debugging-avalonedit-binding-to-document-property Sorry for doing it this way, but there's no answer and it's probably too long for anybody to read. -

    Read the article

  • Rounded Corners Image Change on Hover

    - by Sarfraz
    Hello, I created a rounded box/button and sliced its first corner, the middle bar (which repeats horizontally to adjust the width of the button text/content) and the last corner and used following markup: <div id="left-corner"></div> <div id="middle-bar">About Us</div> <div id="right-corner"></div> These divs have corresponding images from CSS and are floated left. Those three divs create a single rounded button wiht text About Us which is fine. Problem: I have also created similar three slices of hover images but I wonder how to apply hover to those buttons because if I use :hover with these hovered slices, then even hovering on corner images also creates hovering effect. One alternative is to use fixed width buttons and slice buttons completely but I do not want to do that.

    Read the article

  • Best Image Replacement Technique

    - by Josh Stodola
    What is the best (as in cross-browser) technique to do image replacement in CSS? I am using sprites to do my navigation, but I want the markup to remain SEO friendly. Given the following HTML structure... <div id="menu"> <ul> <li><a href="#">Test</a></li> <li><a href="#">Tester</a></li> <li><a href="#">Testing Testing</a></li> </ul> </div> What is the best way to replace the text with a background image using CSS only? I am currently using this... text-indent: -9999px; But, it fails with CSS on, and images off.

    Read the article

  • Interpreting Search Results

    - by Simon
    Hi all, I am tasked with writing a program that, given a search term and the HTML source of a page representing search results of some unknown search engine (it can really be anything, a blog, a shop, Google, eBay, ...), needs to build a data structure of the results containing "what's in the results": a title for earch result, the "details" link, the position within the results etc. It is not known whether the results page contains any of the data at all, and whether there are any search results. The goal is to feed the data structure into another program that extracts meaning. What I am looking for is not BeautifulSoup or a RegExp but rather some clever ideas or algorithms on how to interpret the HTML source. What do I do to find out what part of the page constitutes a single result item? How do I filter the markup noise to extract the important bits? What would you do? Pointers to fields of research covering what I try to to are aly greatly appreciated. Thanks, Simon

    Read the article

  • How do I get the XAML comiler to use textual content property on custom classes?

    - by Duncan
    Given a simple C# class definition like: [System.Windows.Markup.ContentProperty("PropertyOne")] public class SimpleBase { public string PropertyOne { get; set; } public string PropertyTwo { get; set; } } why is it not possible to ommit the sys:string tags around the word Test in the xaml below. <custom:SimpleBase x:Class="TestType" xmlns:custom="clr-namespace:ConsoleApplication1;assembly=" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=mscorlib"> <sys:String>Test</sys:String> </custom:SimpleBase> Somehow the compiler correctly coverts text to string for the type String, why doesn't it work for my custom type? The context can be found on my blog: http://www.deconflations.com/?tag=xaml

    Read the article

  • jquery performance of binding multiple click events.

    - by DA
    I have a situation where I need to bind a click event to an object multiple times. For instance: for(i=0;i<=100;i++){ $myObject.click(function(){ window.location = "myurl"+i+".html"; }) ...do other stuff... } Via that markup, does $myObject end up with 100 click events attached to it? Should I be unbinding the click event first each time? for(i=0;i<=100;i++){ $myObject.unbind('click').click(function(){ window.location = "myurl"+i+".html"; }) ...do other stuff... }

    Read the article

  • How do I get the XAML compiler to use textual content property on custom classes?

    - by Duncan
    Given a simple C# class definition like: [System.Windows.Markup.ContentProperty("PropertyOne")] public class SimpleBase { public string PropertyOne { get; set; } public string PropertyTwo { get; set; } } why is it not possible to omit the sys:string tags around the word Test in the xaml below. <custom:SimpleBase x:Class="TestType" xmlns:custom="clr-namespace:ConsoleApplication1;assembly=" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=mscorlib"> <sys:String>Test</sys:String> </custom:SimpleBase> Somehow the compiler correctly converts text to string for the type String, why doesn't it work for my custom type? The context can be found on my blog: http://www.deconflations.com/?tag=xaml

    Read the article

  • Changing property type in class that implements interface with object type property.

    - by used2could
    I know the title is a bit confusing but bare with me. (I'm up for suggestions on a new title lol) I'm writing a TemplateEngine that will allow me to use my own markup in text based files. I'm wanting to add controls as plugins as the application matures. Currently i've got a structure like the following: interface IControl string Id object Value class Label : IControl string Id string Value class Repeater : IControl string Id List<IControl> Value Now you'll see the strange part right away in the Repeater class with the Value property. I was hoping that having the Value type as object in the interface would allow me the flexibility to expand the controls as i go along. The compiler doesn't like this and for good reason i guess. Does anyone have any suggestions how to accomplish this? Note: Please don't go into suggesting things like use Spark View Engine for templating. There is a reason i'm creating extra work for myself.

    Read the article

  • Linking IronPython to WPF

    - by DonnyD
    I just installed VS2010 and the great new IronPython Tools extension. Currently this extension doesn't yet generate event handlers in code upon double-clicking wpf visual controls. Is there anyone that can provide or point me to an example as to how to code wpf event handlers manually in python. I've had no luck finding any and I am new to visual studio. Upon generating a new ipython wpf project the auto-generated code is: import clr clr.AddReference('PresentationFramework') from System.Windows.Markup import XamlReader from System.Windows import Application from System.IO import FileStream, FileMode app = Application() app.Run(XamlReader.Load(FileStream('WpfApplication7.xaml', FileMode.Open))) and the XAML is: <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="WpfApplication7" Height="300" Width="300"> <Button>Click Me</Button> </Window> Any help would be appreciated.

    Read the article

  • What is a good Javascript RDFa parser implementation?

    - by tremoloqui
    I am looking to implement a client side RDFa based formatting for a web application. This would be similar to Mark Birbeck's ubiquity-rdfa project. Mark's project looks fantastic but it has at least two drawbacks: It is slow. Adding RDFa formatting to a simple page causes a noticeable delay in page loading. It is complex. The ubiquity-rdfa project makes use of the w3c fresnel specification which is complex way to add simple annotations to client markup. I am looking for a lighter weight way of adding annotations through client code and I don't mind doing some work to get it. What I would like is a fast and reliable Javascript RDFa parser. Some implementations that I have found include: W3C RDFa bookmarklet parser Elias Torres RDFa extractor I am interested to know if you would recommend one of these, or another, RDFa Javascript implementation. Thanks!

    Read the article

  • Databinding Error when Recreating object

    - by Maxim Gershkovich
    Hi All, Figure there is a simple solution to this problem but I have been unable to find it. I have databinding in an ASP.Net application to a GridView. This gridview is bound to an ObjectDataSource as per standard usage. The problem I have is that one of my bound fields uses the property DataFormatString="{0:C}" and due to the currency format being displayed when an update is attempted and the object recreated I get a error as such "$13.00 is not a valid value for Decimal." Clearly this is a result of the column using a FormatString and then attempting to bind it back to a decimal property I have in my object called UnitPrice. I am assuming there is some markup I can set that can specify how the value is translated back? Thanks in advance for any help.

    Read the article

  • ASP.NET CustomValidator trying to match to System.EventHandler?

    - by annakata
    I have markup so: <asp:TextBox runat="server" ID="Accountname" /> <asp:CustomValidator runat="server" ControlToValidate="Accountname" OnServerValidate="Accountname_CheckUnique" meta:resourcekey="ACCOUNTNAME_UNAVAILABLE" /> Codebehind so: protected void Accountname_CheckUnique(object source, ServerValidateEventArgs arguments) { arguments.IsValid = Foo(); } Which was working just fine, and then without changing anything on the page ASP now insists: No overload for 'Accountname_CheckUnique' matches delegate 'System.EventHandler' Well no, and nor should it according to MSDN. It's late and I'm tired, anybody know how to fix this or point out the glaring flaw in my comprehension?

    Read the article

  • Shorter Binding expression with validation

    - by Andrii V
    Hi, I'm repeating same binding parameters for every textbox and they're quite long strings (which is not good for many reasons). And I'm wondering if there's a way to make them shorter? For instance all my controls on forms are using the following binding template: Text="{Binding SourceProperty, UpdateSourceTrigger=PropertyChanged, ValidatesOnExceptions=True, ValidatesOnDataErrors=True, NotifyOnValidationError=True}" I'd would like to have something shorter that ideally will take SourceProperty as parameter. Possbly like this: Text="{MyBinding SourceProperty}" or Text="{Binding SourceProperty, Params=MyParams}" One possible option would be to inherit from Binding and create new markup extension. Did someone tried this? Any other ideas how to make these repetetive bindings look better?

    Read the article

  • Html.DropDownListFor() in Mozilla Firefox

    - by Andrey
    I'm rendering a drop down list using Html.DropDownListFor() extension. The markup I get is as follows: select id="NationalityId" name="NationalityId" option value="" /option option selected="selected" value="1"Estonian /option option value="2"Russian /option option value="3"Ukranian /option option value="4"Belorussian /option option value="5"Swedish /option option value="6"Dutch /option /select As you can see, option with value==1 is selected. But in Firefox 3.6.3 it doesn't display as selected, empty string (first option - value == "") is displayed instead. IE7 and Chrome render the page right - the option is selected. Does anybody know what is going on? How do I get this around?

    Read the article

  • When writing to the Windows Event Log, is it possible to create a custom link text for URLs?

    - by thomasnguyencom
    I'm just using the vanilla EventLog.WriteEntry method: EventLog.WriteEntry(EVENT_SOURCE, message, EventLogEntryType.Error, id); Here's how the message shows up in the Event Log, with the links in the parenthesis working just fine, but it's ugly: Example 1: Please contact us via email (mailto:[email protected]) or online (http://example.com). Here's how the message shows up in the Event Log, with the HTML "markup", doesn't even handle it: Example 2: Please contact us via <a href="mailto:[email protected]">email</a> or <a href="http://example.com">online</a>. This is how I would like the message to show up, but with "email" and "online" as the link texts: Example 3: Please contact us via email or online. I've tried the <a href>...</a> HTML tags with no success.

    Read the article

  • PHP - Looking for an HTML Generator/Manager

    - by John Himmelman
    I'm trying to find a tool that I can use to generate markup programatically (non-irl word). Here is an example of what I'm trying to accomplish in pseudo-code... $htmlDoc = new HTML_Document(); $htmlDoc->setTitle('Cool Title'); $htmlDoc->addJs('some_js_file.js'); $htmlDoc->addStylesheet('some_css_file.css'); $divElement = new HTML_Element_Div(); $htmlDoc->append('body', $divElement); $output = $htmlDoc->generate(); What is the best tool for this?

    Read the article

  • PHP - HTML Purifier - hello w<o>rld/world tutorial striptags

    - by JW
    I am just looking into using HTML Purifier to ensure that a user-inputed string (that represents the name of a person) is sanitized. I do not want to allow any html tags, script, markup etc - I just want the alpha, numeric and normal punctuation characters. The sheer number of options available for HTML Purifier is daunting and, as far as i can see, the docs do not seem to have a beggining/middle or end see: http://htmlpurifier.org/docs Is there a simple hello world tutorial online that shows how to sanitize a string removing all the bad stuff out of it. I am also considering just using strip tags: http://php.net/manual/en/function.strip-tags.php or PHP's in built data sanitizing http://us.php.net/manual/en/book.filter.php

    Read the article

  • Jquery Slide to position on click

    - by Andy
    Here's a scenario... I have a column. In the column i have multiple divs with text inside each one. A bit like a list of categories. Which ever one is SELECTED gains a different background colour. What i would like to be able to do is use jquery so that when a different div is clicked on the background colour appears to slide behind the rest of the items until it reaches the one you selected. Does anyone have any idea if this can be done? And if so any idea on Markup? Any help is greatly appreciated.

    Read the article

  • HTML5: Can't drag on-the-fly created <div> tag even though draggable='true' Do I need to "BLESS"

    - by Pete Alvin
    After creating a div on the fly with this markup: $('.circuit').prepend("<div class='component' draggable='true'>TRANSISTOR</div>"); It is NOT draggable itself :( Is jQuery prepend() the correct way to create "live" tags in the DOM? Do I need to somehow bless it a different way to make draggable=true really work? How to I wire it up so that on-the-fly divs can be draggable? AFTER NOTE: I added a static div and that is draggable. INTERESTING: I view both the static and dynamic using FireFox F12 Firebug and they are identical. But one is draggable and one is not!!!

    Read the article

< Previous Page | 41 42 43 44 45 46 47 48 49 50 51 52  | Next Page >