Search Results

Search found 3559 results on 143 pages for 'winforms interop'.

Page 54/143 | < Previous Page | 50 51 52 53 54 55 56 57 58 59 60 61  | Next Page >

  • String Manipulation.

    - by Harikrishna
    I will have a different type of string(string will not have fixed format,they will be different every time) from them I want to remove some specific substring.Like the string can be FUTIDX 26FEB2009 NIFTY 0 FUTSTK ONGC 27 Mar 2008 FUTIDX MINIFTY 30 Jul 2009 FUTIDX NIFTY 27 Aug 2009 NIFTY FUT XP: 29/05/2008 Actuall I want the string from every string defined above like NIFTY-FEB09 ONGC-MAR08 MINIFTY-JUL09 NIFTY-AUG09 NIFTY-MAY08 How can I do that ?

    Read the article

  • C#.NET DataGridView - update database

    - by Geo Ego
    I know this is a basic function of the DataGridView, but for some reason, I just can't get it to work. I just want the DataGridView on my Windows form to submit any changes made to it to the database when the user clicks the "Save" button. On form load, I populate the DataGridView and that's working fine. In my save function, I basically have the following (I've trimmed out some of the code around it to get to the point): using (SqlDataAdapter ruleTableDA = new SqlDataAdapter("SELECT rule.fldFluteType AS [Flute], rule.fldKnife AS [Knife], rule.fldScore AS [Score], rule.fldLowKnife AS [Low Knife], rule.fldMatrixScore AS [Matrix Score], rule.fldMatrix AS [Matrix] FROM dbo.tblRuleTypes rule WHERE rule.fldMachine_ID = '1003'", con)) { SqlCommandBuilder commandBuilder = new SqlCommandBuilder(ruleTableDA); DataTable dt = new DataTable(); dt = RuleTable.DataSource as DataTable; ruleTableDA.Fill(dt); ruleTableDA.Update(dt); } Okay, so I edited the code to do the following: build the commands, create a DataTable based on the DataGridView (RuleTable), fill the DataAdapter with the DataTable, and update the database. Now ruleTableDA.Update(dt) is throwing the exception "Concurrency violation: the UpdateCommand affected 0 of the expected 1 records." Thanks very much!

    Read the article

  • Why does TabStop stop working??

    - by Jerry
    I have a project that uses a series of auto-generated user control instances. The user-control itself exists, but I populate a panel with a series of these user controls, one for each item in my collection. Each user control displays a ton of information, but only ONE text field is editable. All of the other fields have TabStop set to false, and are marked as ReadOnly. The tab order of each user control is set at the time it is created so that the tab-key goes from one field to the next (or ... it's supposed to). When I have TWO fields on my user control whose TabStop is set to true, everything works great. But if I only have ONE field whose TabStop is true, the tab key stops working, and I have to physically CLICK on the next user control for it to gain focus. What's up? Has anyone else seen this behavior? Am I doing something stupid as usual?

    Read the article

  • add row to a BindingSource gives different autoincrement value from whats saved into DB

    - by Ruben Trancoso
    I have a DataGridView that shows list of records and when I hit a insert button, a form should add a new record, edit its values and save it. I have a BindingSource bound to a DataGridView. I pass is as a parameter to a NEW RECORD form so // When the form opens it add a new row and de DataGridView display this new record at this time DataRowView currentRow; currentRow = (DataRowView) myBindindSource.AddNew(); when user confirm to save it I do a myBindindSource.EndEdit(); // inside the form and after the form is disposed the new row is saved and the bindingsorce position is updated to the new row DataRowView drv = myForm.CurrentRow; avaliadoTableAdapter.Update(drv.Row); avaliadoBindingSource.Position = avaliadoBindingSource.Find("ID", drv.Row.ItemArray[0]); The problem is that this table has a AUTOINCREMENT field and the value saved may not correspond the the value the bindingSource gives in EDIT TIME. So, when I close and open the DataGridView again the new rowd give its ID based on the available slot in the undelying DB at the momment is was saved and it just ignores the value the BindingSource generated ad EDIT TIME, Since the value given by the binding source should be used by another table as a foreingKey it make the reference insconsistent. There's a way to get the real ID was saved to the database?

    Read the article

  • Mapping Application for Middle East

    - by Faraz
    We have a desktop application that has been using MapPoint for displaying data on a European map. We now want to support Middle East maps, but MapPoint only support North America and Europe. Is there any other alternative to MapPoint that can be easily integrated in a .NET based Win Forms application?

    Read the article

  • form not showing

    - by Luke
    Perhaps this has something to do with it being the mainForm, but I'll ask the question. I have my mainForm that is the first to load when the program is booted. I then click a button called Add, which should open a new form, and close the mainForm. The problem is, is shows the new form for a split second, then closes both. The code: private void addFrmBtn_Click(object sender, EventArgs e) { saveForm saveform = new saveForm(); saveform.Show(); this.Close(); }

    Read the article

  • Getting "" at the beginning of my XML File after save()

    - by Remy
    I'm opening an existing XML file with c# and I replace some nodes in there. All works fine. Just after I save it, I get the following characters at the beginning of the file:  (EF BB BF in HEX) The whole first line: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> The rest of the file looks like a normal XML file. The simplified code is here: XmlDocument doc = new XmlDocument(); doc.Load(xmlSourceFile); XmlNode translation = doc.SelectSingleNode("//trans-unit[@id='127']"); translation.InnerText = "testing"; doc.Save(xmlTranslatedFile); I'm using a C# WinForm Application. With .NET 4.0. Any ideas? Why would it do that? Can we disable that somehow? It's for Adobe InCopy and it does not open it like this. UPDATE: Alternative Solution: Saving it with the XmlTextWriter works too: XmlTextWriter writer = new XmlTextWriter(inCopyFilename, null); doc.Save(writer);

    Read the article

  • How can I add an Items-like property to my User Control?

    - by Dan Tao
    It's pretty straightforward to add simple properties to a User Control that will appear in the desired categories in the Windows Forms designer, e.g.: [Category("Appearance")] public Color BackColor { get { return _textBox.BackColor; } set { _textBox.BackColor = value; } } What if I want to expose a more complex property, such as a collection of items of a type I define? I'm thinking something along the lines of the ListView.Items property, or the DataGridView.Columns property -- where the user of the control can access this complex property via a more specialized pop-up form (as opposed to a simple TextBox or ComboBox). Even a simple nudge in the right direction would be much appreciated.

    Read the article

  • Datatable and Datagridview.

    - by Harikrishna
    I have datatable table like id name address phoneno 1 abc kfjskl 798798 2 bcd kjdsfl 808909 3 899009 fjsh kjllkjl 5 jfkd And I am displaying this value in the datagridview by code dataGridView1.ColumnCount = Table.Columns.Count; dataGridView1.RowCount = Table.Rows.Count; for (int i = 0; i < dataGridView1.RowCount; i++) { for (int j = 0; j < dataGridView1.ColumnCount; j++) { dataGridView1[j, i].Value = Table.Rows[i][j].ToString(); } } Now I don't want to display row that has some missing value like If I will do that then the datagridview will look like 1 abc kfjskl 798798 2 bcd kjdsfl 808909 How can I do that ?

    Read the article

  • Show bit Column as a checkbox column in unbound Datagridview

    - by Name.IsNullOrEmpty
    Dim Comp = From C In db.Table1 _ Select C.Completed, C.Taken, C.Namne Datagridview1.DataSource = Comp Am using the Entity Framework and Columns Completed and Taken are of bit Datatype. When the query results are displayed in the datagridview, these bit columns are returned as of ColumnType Textbox - so i get a Datagridview textbox column with true or false string values. I want to display Completed and Taken as Checkbox columns (either ticked for True or un-ticked for false) but ofcourse i can't do this in EditColumn dialogue because the Datagridview is unbound. how can i change this in code at runtime

    Read the article

  • Controls resize based on screen resolution

    - by user337173
    I have panel control. More controls are in panel.I set the dock property for panel as 'fill' .The panel are resized based on screen resolution. but the controls remains same.The controls in the panel are not resized based on screen solution. i have more labels and panels and text-boxs and button in the same page. How to set the dock property to resize all controls in page based on screen resolution? Thanks for any help

    Read the article

  • Can you expose XML webservices from a Windows Forms Application?

    - by Andrei
    This might sound like a silly question, but when I search for webservices, I get no information about how to create them in a windows forms application. The only result is how to create and expose them by creating an .aspx page. So my questions is: Can you create and expose webservices within a windows forms application or are they somehow tied in with .asp pages? Thanks! later edit: Is there an example of how to create a webservice in a .cs file and not in a .aspx file?

    Read the article

  • How to display static (shared) object's properties via a Forms PropertyGrid?

    - by Paul Sasik
    I would like to display static (shared) objects at runtime in a PropertyGrid but if I try to set the selected object property of the grid like this: _propertyGrid.SelectedObject = System.Windows.Forms.Application I get this compilation error: 'Application' is a type and cannot be used as an expression. Is there a way to display a static (shared) object or the object's properties in the PropertyGrid?

    Read the article

  • Using Client Application Services in windows forms not working

    - by Nickson
    i am trying to implement asp.net membership, profile and role based security in a windows application by configuring client Application Services for my windows forms application. I have followed both these articles http://www.dotnetbips.com/articles/e863aa3c-0dd6-468d-bd35-120a334c5030.aspx and http://msdn.microsoft.com/en-us/library/bb546195.aspx step-by-step but for some reason i can't get the authentication working. I have a deployed intranet asp.net website which is already using an asp.net membership database for authentication and want to use that same database for authenitcation in my windows forms application. The site URL is http://myServer_Name:My_Port and i am specifying that URL as the both the Authentication service location and Roles service location in the windows application services property tab. But in the windows application login form, when i say Dim msg As String = "Welcome " If Not Membership.ValidateUser(UsernameTextBox.Text), PasswordTextBox.Text)) Then MessageBox.Show("Invalid User ID or Password!") Else msg = msg + UsernameTextBox.Text End If i get my "Invalid User ID or Password!" message even when i supply a valid user name with the corresponding password. i am able to login with the same credentials from the asp.net site. How can i test if the Authentication service location is being reached from the windows application?? Or what other information can i provide here such that one is able to help me get this working??

    Read the article

  • Working examples of winform/WPF apps

    - by melody
    I'm a user interface designer. The project I'm working on is a dashboard that will have several interactive and customizable widgets (think Netvibes, etc.). The development group is going to be using either WinForm or WPF to build the dashboard and widgets. I need to understand the capabilities of each technology better and see a sampling of actual working apps to help accomplish this. I can't download and build examples... need live examples somewhere on the web. Can you point me to live, existing apps? Thx.

    Read the article

  • Slow Databinding setup time in C# .NET 4.0

    - by Svisstack
    Hello, I have got a problem. I have windows forms application with dynamic generated layout, but i have a problem in performance. In this form i use DataBinding from .NET 4.0 and databinding after setup works fine, but he binding setup time for ONE control blocking my application on approx 0.7 second. I have some controls and time of binging setuping is around 2 minutes. I trying all possible solutions, I dont have any ideas without write self binding class. Why is wrong with my code? case "Boolean": { Binding b = new Binding("Checked", __bindingsource, __ep.Name); CheckBox cb = new CheckBox(); /* * HERE is the problem */ cb.DataBindings.Add(b); /* * HERE is the end of problem */ __flp.Controls.Add(cb); __bindingcontrol.AddBinding(b); break; } Without problem code lines all works fast and without binding ;-( but i want binding turn on in normal speed. PS1. I have suspended layout in generation time. PS2. I have same problem with binding TextBox'es, PictureBoxe's, CheckBox is only example. How to do that?

    Read the article

  • Form Closing event

    - by johnm01
    Hi all, I have a smartdevice project targeting windows mobile 6. In the top right corner is an X (provided by the controlbox). i have an event on the form_closing that i was hoping would fire when the cross is clicked. But it doesnt :-( Does anyone know why this event is not firing ??? Thanks :-) John

    Read the article

  • C# Adding Items To A Windows Form

    - by Soo
    I built a little console application in C# and need to add a windows form interface to it. I added a form item, and now have a blank form. I don't know how to go from here and start adding buttons and menus to the form. Is there a form design toolbar or do I have to add buttons and menus using code?

    Read the article

  • Why does this IF statement fail?

    - by ChosenOne
    If variable path is empty, and editor.Text is not empty, the SaveFileDialog should be displayed. Now, why on earth is this damn thing failing??? I have tried this with many different variations of code with the same result: FAIL: if(path.Length >= 1) // path contains a path. Save changes instead of creating NEW file. { File.WriteAllText(path, content); } else { // no path defined. Create new file and write to it. using(SaveFileDialog saver = new SaveFileDialog()) { if(saver.ShowDialog() == DialogButtons.OK) { File.WriteAllText(saver.Filename, content); } } } At the top of code file I have: path = String.Empty; So why the heck it this failing every single time, even after trying all of the below variations? if(path.Length > 1) // path contains a path. Save changes instead of creating NEW file. { File.WriteAllText(path, content); } else { // no path defined. Create new file and write to it. using(SaveFileDialog saver = new SaveFileDialog()) { if(saver.ShowDialog() == DialogButtons.OK) { File.WriteAllText(saver.Filename, content); } } } and if(String.IsNullOrEmpty(path)) // path contains a path. Save changes instead of creating NEW file. { File.WriteAllText(path, content); } else { // no path defined. Create new file and write to it. using(SaveFileDialog saver = new SaveFileDialog()) { if(saver.ShowDialog() == DialogButtons.OK) { File.WriteAllText(saver.Filename, content); } } } and if(String.IsNullOrWhiteSpace(path)) // path contains a path. Save changes instead of creating NEW file. { File.WriteAllText(path, content); } else { // no path defined. Create new file and write to it. using(SaveFileDialog saver = new SaveFileDialog()) { if(saver.ShowDialog() == DialogButtons.OK) { File.WriteAllText(saver.Filename, content); } } } This is making me very angry. How could this fail? Setting a break point reveals that path is definitely null/"".

    Read the article

  • DataGridView Check Box selection

    - by adopilot
    I added datagridview to my win forms app and I also added one Check Box for marking rows. ChekBox work as I accepted until user do sorting of DataGridView, After that previous selection of checkbox column get lost. Is there a way to I make my datagridview remember which row is selected and after user do a sorting.

    Read the article

  • WinAPI magic (TCM_ADJUSTRECT message) and MONO runtime

    - by Luca
    I'm trying to get the same result of a .NET application (see the link Hide TabControl buttons to manage stacked Panel controls for details), but using the MONO runtime instead of the MS .NET runtime. Pratically, when the custom control is executed using the MONO runtime, the underlying message is not sent to the control, causing the tab pages to be shown... There is a portable solution which is elegant as the linked one? If it is not possible, what are possible workarounds (apart from removing/adding tabs at runtime)?

    Read the article

  • Need to get back form controls' information externally

    - by Tom
    Are there any tutorials or guides out there that anyone knows of that will show me how to read forms from an external program and get back information about the controls on the form? Currently, I can get the handle to the form, and I can get the class name, but I need to get more information such as a persistent name and contained data. Thanks. Edit: I now have a way to read the contained data (with the WM_GETTEXT message), however, I still need a persistent name/ID that I can be sure will not change from instance to instance. One way I can think of for doing this is to take the handle, find the position of the control on the window, and then get the handle from the position from then on. Another way is to determine a static ID for the control and then use that to get the handle from then on. The new scope of my problem is how to implement either of these. Any Ideas?

    Read the article

< Previous Page | 50 51 52 53 54 55 56 57 58 59 60 61  | Next Page >