Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
M

mebjen

@mebjen
About
Posts
7
Topics
4
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • LINQ - Multiple Not Exists
    M mebjen

    Guru's I need your help. I've been trying to figure out how to write the following SQL code in VB.NET LINQ but haven't had any luck. Any suggestions would be appreciated: SELECT t.CUSTOMER_ID,t.INVOICE_NUMBER,t.INVOICE_DATE,t.GROSS_AMOUNT_DUE,t.DUE_DATE FROM ARN_1 t WHERE RECORD_TYPE = '1' AND NOT EXISTS(SELECT INVOICE_NUMBER FROM ARN t1 WHERE t1.INVOICE_NUMBER = t.INVOICE_NUMBER AND t1.RECORD_TYPE = '7') AND NOT EXISTS (SELECT INVOICE_NUMBER FROM ARN_1 t2 WHERE t2.INVOICE_NUMBER = t.INVOICE_NUMBER AND t2.RECORD_TYPE = '5') AND t.DUE_DATE < '2017-11-13'

    MB

    LINQ csharp database linq sales

  • Query dataTable with .Compute
    M mebjen

    Hi Dave, Thanks for the feedback - I have made the following changes: Dim salesTable As DataTable salesTable = New DataTable

    Dim col_invNo As DataColumn = New DataColumn("invNo")
    col_invNo.DataType = System.Type.GetType("System.String")
    salesTable.Columns.Add(col_invNo)

        Dim col\_custId As DataColumn = New DataColumn("custId")
        col\_custId.DataType = System.Type.GetType("System.String")
        salesTable.Columns.Add(col\_custId)
    
        Dim col\_custName As DataColumn = New DataColumn("custName")
        col\_custName.DataType = System.Type.GetType("System.String")
        salesTable.Columns.Add(col\_custName)
    
        Dim col\_shipToId As DataColumn = New DataColumn("shipToId")
        col\_shipToId.DataType = System.Type.GetType("System.String")
        salesTable.Columns.Add(col\_shipToId)
    
        Dim col\_shipToName As DataColumn = New DataColumn("shipToName")
        col\_shipToName.DataType = System.Type.GetType("System.String")
        salesTable.Columns.Add(col\_shipToName)
    
        Dim col\_shipToCity As DataColumn = New DataColumn("shipToCity")
        col\_shipToCity.DataType = System.Type.GetType("System.String")
        salesTable.Columns.Add(col\_shipToCity)
    
        Dim col\_shipToState As DataColumn = New DataColumn("shipToState")
        col\_shipToState.DataType = System.Type.GetType("System.String")
        salesTable.Columns.Add(col\_shipToState)
    
        Dim col\_invDate As DataColumn = New DataColumn("invDate")
        col\_invDate.DataType = System.Type.GetType("System.DateTime")
        salesTable.Columns.Add(col\_invDate)
    
        Dim col\_category As DataColumn = New DataColumn("category")
        col\_category.DataType = System.Type.GetType("System.String")
        salesTable.Columns.Add(col\_category)
    
        Dim col\_itemId As DataColumn = New DataColumn("itemId")
        col\_itemId.DataType = System.Type.GetType("System.String")
        salesTable.Columns.Add(col\_itemId)
    
        Dim col\_desc As DataColumn = New DataColumn("desc")
        col\_desc.DataType = System.Type.GetType("System.String")
        salesTable.Columns.Add(col\_desc)
    
        Dim col\_shipQty As DataColumn = New DataColumn("shipQty")
        col\_shipQty.DataType = System.Type.GetType("System.Int32")
    
    Visual Basic database help

  • Query dataTable with .Compute
    M mebjen

    Hi All, Can't figure this out . . . . I am trying to run a .Compute against a dataTable but am getting an 'EvaluateExecption was unhandled' error: Cannot perform '<' operation on System.String and System.Double. Here is my code: Dim salesTable as DataTable salesTable = New DataTable With salesTable .Columns.Add("invNo") .Columns.Add("custId") .Columns.Add("custName") .Columns.Add("shipToId") .Columns.Add("shipToName") .Columns.Add("shipToCity") .Columns.Add("shipToState") .Columns.Add("invDate") .Columns.Add("category") .Columns.Add("itemId") .Columns.Add("desc") .Columns.Add("shipQty") .Columns.Add("extPrice") End With Public Sub getYrSales(ByVal stn As String) Dim yrSales = salesTable Dim x0 As Object = yrSales.Compute("SUM(extPrice)", "shipToName = '" & stn & "'" & "AND invDate >" & begDate & "AND invDate <" & endDate) End Sub

    Thanks, MB

    Visual Basic database help

  • VB.NET / APPLICATION SETTINGS
    M mebjen

    Dave, It is 'user-scope' Private Function genPoNo(ByVal user As String) As String 08 Dim strNum As String = "1" 09 poIncNo = My.Settings.po + 1 '----IT'S INCREMENTED HERE ! 10 Dim poNum As String 11 Select Case user 12 Case uFred 13 poNum = strNum & userId + CStr(poIncNo) 14 Return poNum 15 End Select 16 End Function Thanks MB

    Visual Basic csharp question

  • VB.NET / APPLICATION SETTINGS
    M mebjen

    OK - lets see if this helps - have the following variable under Public Class Main: Dim poIncNo As Integer Then in the formLoad Event I have: txtBx_poNo.Text = genPoNo(currUser) Private Function genPoNo(ByVal user As String) As String Dim strNum As String = "1" poIncNo = My.Settings.po + 1 Dim poNum As String Select Case user Case uFred poNum = strNum & userId + CStr(poIncNo) Return poNum End Select End Function In Application.Settings I have: Name = po Type = integer Scope = user Value = 100001 Thanks, MB

    Visual Basic csharp question

  • VB.NET / APPLICATION SETTINGS
    M mebjen

    I have an the following application setting [Name: PO / Type: Integer / Scope: User / Value: 100001] This setting increments every time the user logs into the application and is displayed in a textbox - it is working fine on 4 different workstations - but on workstation 5 it is only displaying 1 then 2 then 3 and so on instead of 100001,100002,100003 . . . .. There is a mixture of operating systems anything from XP to Windows 8. Workstation 5 is Windows 7. Is there something obvious I'm missing? Thanks, MB

    Visual Basic csharp question

  • LINQ Query / "between" dates
    M mebjen

    Hi All, I've spent way to long on this - I'm trying to get distinct values from a dataTable: begDate = 2007-11-18 / endDate = 2007-12-31 Why does this work: Returns 4 rows Dim shipTo = From row In osDS.Tables(0).AsEnumerable _ Order By row(7) _ Where row(0).ToString = cust _ And row(1).ToString > begDate _ Select row(7) Distinct This doesn't work: Results Empty / Enumeration yield no results.... Dim shipTo = From row In osDS.Tables(0).AsEnumerable _ Order By row(7) _ Where row(0).ToString = cust _ And row(1).ToString < endDate _ Select row(7) Distinct But what I really want is: (but it doesn't work either) Dim shipTo = From row In osDS.Tables(0).AsEnumerable _ Order By row(7) _ Where row(0).ToString = cust _ And row(1).ToString > begDate _ And row(1).ToString < endDate _ Select row(7) Distinct Thanks in advance . . . . MB

    LINQ csharp database linq question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups