- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 14
- Posts with Upvotes
- 13
- Upvoting Members
- 10
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
91 Posted Topics
Re: have a look a this: [http://msdn.microsoft.com/en-us/library/system.data.common.dataadapter.update(v=vs.110).aspxClick Here] You might want to define your da and you dt at the module level and use the builder to create update sql command. | |
The following (see the full code below) successfully adds a page in a section in Onenote. What I don't seem to be able to do is to get the lastly created page on top of the section. Here's the code that is puzzling me. onenoteApp.GetHierarchy(sectionId, OneNote.HierarchyScope.hsPages, out string xmlPages); var … | |
I prepare a table in Excel within a Using () statetement. At the end I UsedRange.Copy() to what I understand is the clipboard. Then I Selection.PasteExcelTable in a Word document. I get an COM Exception "command failed". When I activate the word document and press Ctrl+V the table gets copied. … | |
When I execute this progammatically, I get a table with row heights much larger than when I do this manually. Note : Sel is the Word.Selection object and the Clipboard contains an Excel Table. public void AddClipboard() { Sel.PasteExcelTable(false,false, false); var t = Sel.Tables[Sel.Tables.Count]; t.AutoFitBehavior(Word.WdAutoFitBehavior.wdAutoFitContent); } | |
Hi have this code that runs well for me. It's part of my WordWrapper where Sel is defined as the Selection object. I tried to save `Sel.Font to a var f` variable, and reset `Sel.Font = f`before exit, but that does not work. "Value out of range". /// <summary> /// … | |
Re: This is definitely a double dot problem. You need to wrap the Excel object and implement the IDisposable interface in the wrapper. You also need to release the each Excel.Object you create. A minima you need the code I'm exposing below. ` Imports Microsoft.Office.Interop Public Class clsExcel Implements IDisposable Public … | |
Re: Assuming your Persons have (one or more) Orders, you probably want to add an Orders (as List(Of Order)) property to your Person class. You will then be able to Json you Persons. Let me know if my assumption is correct. | |
I cannot find anything in phpExcel documentation. What I would like is to end up with an associative array with keys from the first row in the excel worksheet. It's something that can be done of course, but is there a native method? | |
I'm using Excel interop and it seems that this functionality needs to run in the User Interface thread. So I execute that from the ProgressChanged backgroundworker event. Is there a way to have the dowork event (that invoked the progress changed event) interrupt execution until the ProgressChanged event is finished? … | |
I have this Linq expression that works well. What is the right approach to test if it has returned anything? internal static void getCreditNotes(string invoiceId, out DataTable creditNotes,out double total) { total = 0; creditNotes = new DataTable(); var q = dt.AsEnumerable(). Where(r => (string) r["invoiceId"] == invoiceId && (string) … | |
I may be very wrong, but in the web world, just installing Bootstrap gives you some basic control over how you controls look. Is there something similar for WPF? I don't seem to find anything, I have a very basic little wpf application with a pageframe, buttons, textblocks and textboxes. … | |
I have this control on my (wpf)form Status <TextBlock x:Name="Status" HorizontalAlignment="Left" Margin="138,0,0,0" TextWrapping="Wrap" Text="TextBlock" VerticalAlignment="Top" Grid.ColumnSpan="3" Height="67" Width="577" Grid.Row="1" IsHyphenationEnabled="True" UseLayoutRounding="False"/> It seems that just setting Status.Text=someValue from within a click event does not refresh until the event is completed. How can this be done (in C#) if one wants … | |
Re: Are you using System.Linq.Dynamic; assuming it exists in your VS. It does not exists in my VS2012 (as far as I have checked). You can download it from here : [Click Here](http://weblogs.asp.net/scottgu/dynamic-linq-part-1-using-the-linq-dynamic-query-library) | |
Re: Have you thought of entering a blank line after you copy so that the next table would be in a separate paragraph? | |
Re: I use interop from vb.net 2008, and they work fine with office 2007 all the way to 2013 included. Not sure about 2003 though. Why do you think you need 14.0 object library? | |
Re: Your payment_apply JOIN does not have a filter. I hope for your sake that that is your problem, otherwise you should rethink your logic from scratch. | |
Re: You can execute the code that triggers the exception in the caller routine between the instantiation of the form and the show(). If the error is triggered, you can then not call the show event. Not sure how "kosher" this solution is but it would be something like this: dim … | |
Re: What is it that makes you think your approach can be improved? | |
Re: Can't you just compute the total at the moment you populate the fields based on the values that are passed by the dgv? The values are probably kept as numeric values no, so you could set the total textbox with the total, formatted as you choose. | |
Re: Well, I think that what this is trying to tell you is that you are supposed to pass the column number (the zero based sequence) into getstring. Here's the definition of [GetString](http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqldatareader.getstring(v=vs.110).aspx) 'Declaration Public Overrides Function GetString ( _ i As Integer _ ) As String | |
Re: Not sure how helpful this is going to be for you but here is how this looks in one of my projects (called B040) Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.b040.frmMain End Sub | |
Re: .. then there is the question, do we have to take into account that the users can enter separators like "/" or "-". It wouldn't make it much more complex, but if that is not in the picture (because the imput field is made numeric only) then there is no … | |
Re: I may be very wrong, but it seems to me that you are testing an awful lot of times (the number of persons x the number of events) whether `Incident_Type.text = "Party"` and `"Event_Assoc1.text <> "Guest"` Unless I'm missing something major, or you are not telling us something this : … | |
Re: I think it would be more elegant to use the HTML5 placeholder approach, where if there is no value in the table, you would put something like "put a value", and make sure at validation of the textbox that a correct value was entered, or delete whatever was there. If … | |
Re: Instead of filling the detail tableadapter in the load event of the form, you could do that in the "RowEnter" event of the header datagridview. You need to pass the key to the detail tableadapter. You will find the the key in `DataGridView.CurrentRow.Cells("keyfiedColumnName").value.` Let us know if you need help … | |
Re: You define `a` as a `date` in line 7, you should not be surprised that it cannot accept a .`tostring` expression no? | |
I have a form with a dgv on it. The dgv has 1 column defined as a DataGridViewCheckBoxColumn. I would like this dgv to behave as a radiobutton group, i.e. when I click on one cell, that should be set to true, and the others to false. I've got it … | |
Re: The checkboxcolumn is rather straightforward. I'm not sure that is your problem. Is your datagridview bound? If so you need to bind the CheckBoxColumn to a boolean variable. Otherwise if you can see in the cell's value property if the checkbox was checked or not. Let us know if this … | |
Re: Hmm.... maybe in Notepad Wordwrap (under Format) is set? | |
Re: I like tooltips if that works for you. You set this in the form's load event. ` ToolTip1.SetToolTip(Button1, "This is a tooltip")``` Mind you this is VB. I would be very much surprised that it is different in c#. Let us know if this helps, and if we can be … | |
Re: Well one way would be to add an "<all>" options in the itemlist of the comboboxes, and set that as the default. You would have to adjust your sql to take into account those "<all>" entries in your parameters (mostly by not including the corresponding filtering clause). Please let us … | |
I have this routine that works in outlook 2010 but not in outlook 2013 (365). ` Public Sub readTextFile(oFolder As eFolder) If oFolder = NotSupported Then Exit Sub If oFolder = Inbox Then ActiveExplorer.CurrentView = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox).Views("MgInbox") Else ActiveExplorer.CurrentView = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderSentMail).Views("MgSentMail") End If Dim oTV As Outlook.TableView Set oTV = ActiveExplorer.CurrentView … | |
Re: Wouldn't changing `cc=cc+1`on line 21 into `cc=cc+iif(cc=1,2,1)` do what you want? In a zero based logic you will put your valuese in columns 0,1,3 and 4. If you'd allow me, I'd suggest that you be slightly less cryptic in the way you name your variables. There's no extra charge for … | |
Re: Assuming you would want your grid to display the pengguna of which you entered the name in some textbox, you could use the following routine (you would call the sub as `setGridToPengguna(nameTextbox.text)` Private Sub setGridToPengguna(name As String) Dim rowIndex As Integer = 0 For Each r As DataGridViewRow In dgv.Rows … | |
Re: You must have a problem somewhere else, because I took your code as is, and it compiled and ran fine. Hope this helps and good luck. | |
Re: It may also be useful to point out that polymorphism is a characteristic of your design, whereas inheritance is a feature of your development system. For exammple when in winforms, you drag a button and a texbox on your form, ***you experience polymorphism***. This is made possible because both textboxes … | |
Re: This routine will give you the correct string to add to your sql. You do need to convert the input text into a valid date variable butt this approach will work no matter what your regional setting is or in which format your user entered the date. Shared Function cDateForJet(ByVal … | |
Until now I've been replacing Enter key behaviour in controls (in base classes) with Tab key behaviour with the following code in the keypress event handler : If e.KeyChar = Chr(13) Then SendKeys.Send(vbTab) e.Handled = True End If Although it's worked for me until now, I have serious doubts about … | |
Re: Frankly, I don't see how you can do this without a loop, but here is one solution : Sub Main() Console.WriteLine(removeFirstTwoWords("word1 word2 word3 word4")) Console.ReadKey() End Sub Function removeFirstTwoWords(s As String) As String Dim a() As String = Split(s, " ") Dim result As String = "" For i As … | |
Re: Hey there again: How's this? using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication3 { class Program { static void Main(string[] args) { string name = "Firstname Lastname"; string code = generateCode(name) ; Console.WriteLine("Code : " + code); Console.ReadKey(); } private static string generateCode(string n) { string[] … | |
Re: Does this `Dim dr As OleDb.OleDbDataReader = GetData(qry)` compile at all? I don't think GetData does what you think it does. You need to use an oledbCommand, connect to your database, link the connection to the command and submit your query to the command which may eventually produce a datareader. … | |
Re: Have you tried if application.doevents works for you? I've never used it in vb.net, but in vba it would do what you expect. Look at the documentation here : http://msdn.microsoft.com/en-us/library/system.windows.forms.application.doevents(v=vs.110).aspx Not sure it's "best pactices" though. You're better off use threads and the "backgroundworker". See if this http://msdn.microsoft.com/en-us/library/vstudio/system.componentmodel.backgroundworker works for … | |
![]() | Re: You can set the attributes in vb.net. Have a look at this: http://msdn.microsoft.com/en-us/library/system.io.filesysteminfo.attributes(v=vs.110).aspx You could write a program that goes through all your folders and set that attribute. |
I have a textbox and a label bound to the same member via a bindingsource. I would have expected that at some point when the user changes the textbox, the label would be refreshed, yet it is not. What am I missing here? | |
Re: It looks like the update command was not created in lawyerList. Check lawyerList.UpdateCommand. If that is empty, then you should create an sqlCommandBuilder(lawyerList) and execute its GetUpdateCommand() method before your call to Update, or in a constructor. Hope this help and good luck. | |
Re: I agree with cgeier that your structure is not optimal, but let's assume that it is good enough for what you are trying to do. So the structure of the text file seems to be that for each entry there are three lines, one that starts with a "-" and … | |
Re: Have you thought of checking `PFC_Xpress.Tables("EVENT INFO").Rows.count` to check if there are any rows in your table? | |
Re: Have a look at the code below, and see if that works for you, and if not, let us know why. Thanks and good luck. using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { makeTexfile(); Boolean ok = checkUser("name1","password1"); if … | |
Re: Between the instantiation of the child form and the call to the show you can set the top and the left properties of the form. The top would be approximately the sum of the top-of-the-parent- form and the height-of-the-parent-form. I guess that the form's top and height are available, otherwise … | |
Re: You're ok. Assuming your code works. The idea of having the user downloading the ole connection provider is really very good (in fact I might steal that from you :) ). If you know that the provider is not installed, then why not install it, there is not really a … |
The End.