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
U

User 13592306

@User 13592306
About
Posts
7
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Connection string for Integrated Security
    U User 13592306

    Hello:
    I am trying to connection using old school VBA.

    This works in VBA!
    connectionString = "Provider=sqloledb;Data Source=w2012;Initial Catalog=M1_SU;User Id=m1view;Password=connect2m1;"

    This works in VB.NET, but says the server does not exist or access is denied...
    "Provider=sqloledb;Data Source=sage;Initial Catalog=JobSheet;persist security info=True;Integrated Security=SSPI;"

    Why would the server be available in VB.NET but not in VBA?

    Here's the complete code. I must be missing something..
    Sub GetJobs_Click()
    Dim connectionString As String
    ' connectionString = "Provider=sqloledb;Data Source=w2012;Initial Catalog=M1_SU;User Id=m1view;Password=connect2m1;"
    connectionString = "Provider=sqloledb;Data Source=sage;Initial Catalog=JobSheet;persist security info=True;Integrated Security=SSPI;"
    Dim cn As ADODB.Connection
    Set cn = New ADODB.Connection

    Dim rs As ADODB.Recordset
    Set rs = New ADODB.Recordset
        
    Dim sql As String
    sql = "SELECT \* From \[JobSheet\].\[dbo\].\[JobInfo\] ORDER BY JobNo "
    MsgBox (sql)
        
    cn.connectionString = connectionString
    \[COLOR="#FF0000"\]cn.Open ' ERROR'S HERE\[/COLOR\]
        
    rs.Open sql, cn, adOpenKeyset, adLockReadOnly, adCmdText
    rs.MoveFirst
    Do While Not rs.EOF
        MsgBox (rs.Fields("JobNo"))
        rs.MoveNext
    
    Loop
    
    rs.Close
    Set rs = Nothing
        
    cn.Close
    Set cn = Nothing
    

    End Sub

    Thanks!

    Visual Basic csharp database sysadmin security

  • How to query a Dataset using LINQ?
    U User 13592306

    Thanks for all the help, and I will reference all of it. My issue was null values...

    var q =
    from a1 in dt_Jobs.AsEnumerable()
    orderby a1.Field("City")
    where (a1.Field("City") != null)
    select a1.Field("City");
    var lstCity = q.Distinct().ToList();
    cboCity.DataSource = lstCity;

    LINQ csharp css database linq tutorial

  • Linq Query Limitations, more than one query fails
    U User 13592306

    I think I got it, Thanks for the help!

    var q =
    from a1 in dt_Jobs.AsEnumerable()
    orderby a1.Field("City")
    where (a1.Field("City") != null)
    select a1.Field("City");
    var lstCity = q.Distinct().ToList();
    cboCity.DataSource = lstCity;

    C# question csharp database linq sales

  • Linq Query Limitations, more than one query fails
    U User 13592306

    Sorry for the confusion, there are errors. Exception thrown: 'System.FormatException' in mscorlib.dll Exception thrown: 'System.NullReferenceException' in ResourcePlanningC2.exe Exception thrown: 'System.InvalidCastException' in mscorlib.dll Exception thrown: 'System.NullReferenceException' in ResourcePlanningC2.exe Exception thrown: 'System.FormatException' in mscorlib.dll Exception thrown: 'System.NullReferenceException' in ResourcePlanningC2.exe Exception thrown: 'System.NullReferenceException' in ResourcePlanningC2.exe Exception thrown: 'System.FormatException' in mscorlib.dll The program '[12772] ResourcePlanningC2.exe' has exited with code -1 (0xffffffff). It must be hanging on some null values. Is there an easy way to handle this?

    C# question csharp database linq sales

  • Linq Query Limitations, more than one query fails
    U User 13592306

    I am trying to set the datasources for comboboxes. There is a datasource in the first, but not in the second. If I flip them around, I get the opposite effect.

    C# question csharp database linq sales

  • Linq Query fails after first
    U User 13592306

    Hello: I simply want to write multiple queries to assign information.

    var q =
    from a1 in dt_Jobs.AsEnumerable()
    orderby a1.Field("Customer")
    select a1.Field("Customer");
    var lstCustomer = q.Distinct().ToList();
    cboCustomer.DataSource = lstCustomer;

    q =
    from a1 in dt_Jobs.AsEnumerable()
    orderby a1.Field("City")
    select a1.Field("City");
    var lstCity = q.Distinct().ToList();
    cboCity.DataSource = lstCity;

    The first block works, the second fails. How can I achieve something like this?? Thanks!

    LINQ question csharp database linq sales

  • Linq Query Limitations, more than one query fails
    U User 13592306

    Hello: I simply want to write multiple queries to assign information.

                var q =
                    from a1 in dt\_Jobs.AsEnumerable()
                    orderby a1.Field("Customer")
                    select a1.Field("Customer");
                var lstCustomer = q.Distinct().ToList();
                cboCustomer.DataSource = lstCustomer;
    
                q =
                    from a1 in dt\_Jobs.AsEnumerable()
                    orderby a1.Field("City")
                    select a1.Field("City");
                var lstCity = q.Distinct().ToList();
                cboCity.DataSource = lstCity;
    

    The first block works, the second fails. How can I achieve something like this?? Thanks!

    C# question csharp database linq sales
  • Login

  • Don't have an account? Register

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