Search:

Type: Posts; User: b5177241

Page 1 of 4 1 2 3 4

Search: Search took 0.03 seconds.

  1. Replies
    7
    Views
    863

    Re: to with or not to with

    But I get a syntax error on my first example, if I omit the "With". e.g. like this:



    Dim InputParameters(1) As SqlParameter
    InputParameters(0) = New SqlParameter("@report", SqlDbType.VarChar)...
  2. Replies
    7
    Views
    863

    Re: to with or not to with

    I must have missed something there! It looks like both those examples use the "With" keyword. Since I have an example that works without the keyword, I'm trying to understand when the keyword is...
  3. Replies
    7
    Views
    863

    Re: to with or not to with

    yes. but that is not what I want to know. I really want to know why sometimes the keyword "With" is required in this context and sometimes not.
  4. Replies
    7
    Views
    863

    to with or not to with

    Hi -- I see that I can do this:


    Dim InputParameters(1) As SqlParameter
    InputParameters(0) = New SqlParameter("@report", SqlDbType.VarChar) _
    With {.Value =...
  5. Replies
    2
    Views
    484

    Do I need CDbl in this case?

    I'm maintaining an old program that has patterns like this


    dim d as double
    dim i, j as integer

    d = cdbl(i/j)

    ' or
  6. Replies
    1
    Views
    1,833

    where is Microsoft.Office.Core.NewFile

    I'm getting the error below trying to open a new workbook in Excel:



    Imports Microsoft.Office.Core
    ...
    Dim myExcel As New Excel.Application
    myExcel.Visible =...
  7. Replies
    3
    Views
    670

    Re: Visual Studio and SSMS

    Yeah its not about managing the files in VS. That part is easy. The problem is using Server Explorer. If you expand the Tables or Stored Procedures branches, it shows you all of them (hundreds or...
  8. Replies
    3
    Views
    670

    Visual Studio and SSMS

    I have a few projects that include two major components:

    1. vb.net programs

    2. SQL Server stored procedures

    Ideally I'd like to be able to work on both from one IDE. So far, I haven't been...
  9. Replies
    10
    Views
    9,465

    Re: "like" vs. "instr"

    I agree. I was just curious. The Regex timings didn't really surprise me
  10. Re: Question on best practices for project structure

    Well, I'm not permitted to refactor the code or split up larger methods. I have been moving the larger subroutines to their own files which leaves things as they are but makes them easier to edit. ...
  11. Re: Question on best practices for project structure

    Good question! The original program was a single module (static class, right?) No, I don't try to instantiate objects from it, except for the one object created when at program startup (which...
  12. Replies
    10
    Views
    9,465

    Re: "like" vs. "instr"

    Well, no, but that was not the point of my question.



    as is the Regex library



    Dim isMatch As Boolean = Regex.Match("foo", "f.*o", RegexOptions.IgnoreCase).Success
  13. Re: Question on best practices for project structure

    Interesting. Note that I am not working on a GUI app. It does SQL queries and builds reports in Excel. What about a class that has many methods and that grows to many thousands of lines? Still...
  14. Question on best practices for project structure

    I've been handed an old vb6 program to update to vb.net. So far, so good. The new version runs and produces equivalent results. Now, I'm looking for ideas on how to better manage the beast. It's...
  15. Replies
    10
    Views
    9,465

    Re: "like" vs. "instr"

    Thanks for the tip! I changed to using StopWatch and I like it!
  16. Replies
    10
    Views
    9,465

    Re: "like" vs. "instr"

    I don't think they are that different. They can both be used to achieve similar goals. Even though InStr returns an integer. It's a small step from an integer to a Boolean. In any case, I reran it...
  17. Replies
    10
    Views
    9,465

    Re: "like" vs. "instr"

    Hey Shaggy. Yes, I have a test app, though not forms-based. I just can't get interested in VB GUIs at the moment. It's what I use to test out new concepts -- and for me as a VB newbie, loads of...
  18. Replies
    10
    Views
    9,465

    "like" vs. "instr"

    I got curious about these two different ways of checking if a string has some substring. So, I set up a little test:



    Sub Main()
    Dim foo As String = "foo"
    Dim start_time...
  19. Replies
    9
    Views
    1,177

    Re: Specify version of Excel to open?

    did some reading...I have to forget it for the moment since my VS is 2008. It doesn't play nicely with Excel 2010 (or play at all)
  20. Replies
    9
    Views
    1,177

    Re: Specify version of Excel to open?

    Yes I have a reference to Microsoft.Interop.Office.Excel. Is there a tutorial on PIAs someplace I can go to?
  21. Replies
    9
    Views
    1,177

    Re: Specify version of Excel to open?

    Oh, but I don't want to modify the registry (I didn't get that from your earlier post). I want to be able to choose at runtime which version to launch w/o modifying and possibly restoring registry...
  22. Replies
    9
    Views
    1,177

    Re: Specify version of Excel to open?

    Thanks! The refs are helpful for discovering the versions of Excel installed (but I know what I have installed). What I need is a programatic way from vb.net to force this line:



    Dim myExcel...
  23. Replies
    9
    Views
    1,177

    Specify version of Excel to open?

    I have two versions of Excel on my desktop: 2003 and 2010. I have this code:



    Dim myExcel As New Excel.Application
    myExcel.Visible = True
    Dim myBook As Excel.Workbook...
  24. Replies
    3
    Views
    501

    struct or class for list members?

    I have an application that reads data from a SQL query into a list corresponding to the rows of the query. So, I have something like this:



    class myrow
    public foo
    public bar
    ......
  25. Replies
    13
    Views
    912

    Re: Refer to part of an array?

    Perfect! These are just the ideas I'm looking for!!
  26. Replies
    13
    Views
    912

    Re: Refer to part of an array?

    I agree but that's not the point. I'm looking for a general solution here and just responding to the idea of passing array elements into the subroutine.
  27. Replies
    13
    Views
    912

    Re: Refer to part of an array?

    Well, suppose the array is large (millions of items). Passing elements is not really an option for that.
  28. Replies
    13
    Views
    912

    Refer to part of an array?

    I'd like to know if it is possible to refer to section of an array. e.g.



    dim a(10) as integer
    foo(<reference to array a starting at item 2>) 'only use items 2 to 9 of the array
    ...
    sub...
  29. Replies
    4
    Views
    1,661

    Re: pasting arrays into excel ranges

    yeah. I'm using something like that. Funny thing is the Transpose function returns a 1-based array in VB. I didn't know that was possible! OTOH, Excel seems happy if the array is 1- or 0-based,...
  30. Replies
    4
    Views
    1,661

    Re: pasting arrays into excel ranges

    Bumping
  31. Replies
    4
    Views
    1,661

    Re: pasting arrays into excel ranges

    PS -- I'm talking to Excel 2003
  32. Replies
    4
    Views
    1,661

    pasting arrays into excel ranges

    I'm working on pasting arrays into excel ranges. Suppose I have a range: A1:A5
    and an array a = {1,2,3,4,5}. I can set up the problem like this:



    Dim myExcel As New Excel.Application...
  33. Replies
    3
    Views
    565

    Re: visual studio connecting to sql server

    Cool! Just what I need!!
  34. Replies
    3
    Views
    585

    Re: Can this be done?

    i is the new value for aa.ab.bc.cx
  35. Replies
    3
    Views
    565

    visual studio connecting to sql server

    Using Visual Studio 2008, I see that it is possible to connect to a SQL Server instance and work with stored procedures found there. That is nice! Now, I have a project that includes some stored...
  36. Replies
    3
    Views
    585

    Can this be done?

    This is a follow up to my thread about Func(Of T). Here I've trimmed back the problem to bare bones. (I wrote this up at home where I don't have access to a VB compiler so I apologize for syntax...
  37. Replies
    14
    Views
    1,893

    Re: Trouble with func(of T)

    OK -- but here I need to be able to modify the contents of objrpt
  38. Replies
    14
    Views
    1,893

    Re: Trouble with func(of T)

    objrpt is an instance of a large class. Not so sure passing it by val is appropriate
  39. Replies
    14
    Views
    1,893

    Re: Trouble with func(of T)

    Dim DelCol = Function(col As Integer) _
    DeleteColumn(objrpt, col)


    gives the error message:
  40. Replies
    14
    Views
    1,893

    Re: Trouble with func(of T)

    Now I have:



    Private Function DeleteColumn(ByRef objrpt As ExcelReport, ByVal col As Integer) As Boolean
    Dim objrng As Excel.Range
    objrng = objrpt.objXLSheet.Columns(col)...
Results 1 to 40 of 122
Page 1 of 4 1 2 3 4



Click Here to Expand Forum to Full Width