Search found 43 matches

by edstaffin
Wed 30 Jun 2010 13:40
Forum: dotConnect for Oracle
Topic: "Error on executing DbCommand."
Replies: 2
Views: 3541

"Error on executing DbCommand."

Talk about a useless error message!
I am writing some pretty simple linq code to do an insert of a couple of records into an oracle database using dotConnect. However, when I do the db.submitChanges it blows up with "Error on executing DbCommand."

Code: Select all

        Try

            Dim db As New CommonDBContext
            Using oScope As New TransactionScope
                Dim oUser As New User

                With oUser
                    .Address_1 = txtAddress1.Text
                    .Address_2 = txtAddress2.Text
                    .Address_3 = txtAddress3.Text
                    .City = txtCity.Text
                    .State_Code = ddlState.SelectedValue
                    .Country_Code = ddlCountry.SelectedValue
                    If ddlCountry.SelectedValue = "US" Then
                        .County_Code = ddlCounty.SelectedValue
                    Else
                        .County_Code = ""
                    End If
                    .Postal_Code = txtZip.Text
                    .Company_Name = txtCompany.Text
                    .Email_Address = txtEmail.Text
                    .First_Name = txtFirstName.Text
                    .Last_Name = txtLastName.Text
                    .Middle_Name = txtMiddle.Text
                    .Ldap_Account = sLdap
                    .Work_Phone = txtWorkPhone.Text
                    .Mobile_Phone = txtMobilePhone.Text
                    .Fax_Number = txtFax.Text
                    .State_Name = ddlState.SelectedItem.Text
                    If ddlCountry.SelectedValue = "US" Then
                        .County_Name = ddlCounty.SelectedItem.Text
                    Else
                        .County_Name = ""
                    End If
                    .Modified_By = sLdap
                    .Modified_Date = Now
                    .Is_Active = True
                    .Created_By = sLdap
                    .Created_Date = Now
                End With
                db.Users.InsertOnSubmit(oUser)
                db.SubmitChanges()
                Dim oAUR As New App_User_Role
                With oAUR
                    .App_Name = ConfigConstants.GC_APP_NAME
                    .Role_Code = 3 ' requester
                    .Ldap_Account = sLdap
                End With
                db.App_User_Roles.InsertOnSubmit(oAUR)
                db.SubmitChanges()
                oScope.Complete()
            End Using
        Catch ex As Exception
            ErrorLog.Handle_Error(ex)
        End Try
Pretty simple, huh? Anyone with any ideas? I sure could use the help.
Thanks ... Ed
by edstaffin
Thu 29 Apr 2010 18:34
Forum: LinqConnect (LINQ to SQL support)
Topic: How to call proc in package with OUT param cursor?
Replies: 4
Views: 2570

How to call proc in package with OUT param cursor?

Hi,
I have a pretty simple proc defined in a package as shown below.
My question is how do I can I call this using linq and get a IQueryable back? Right now, when I drop it on the designer I get the following which, as you can see returns a system.Int32.
Any help would be great!
THanks ... Ed

Code: Select all


       ''' 
        ''' There are no comments for Get_App_Role_List in the schema.
        ''' 
         _
        Public Function Get_App_Role_List( Sappname As String) As System.Int32
            Dim res As IExecuteResult = Me.ExecuteMethodCall(Me, CType(MethodInfo.GetCurrentMethod(), MethodInfo), Sappname)
            Return CType(res.ReturnValue, System.Int32)
        End Function


 PROCEDURE Get_App_Role_List(sAppName IN VARCHAR2, cData OUT cOutput) IS 
   /* --------------------------------------------------------------------------- 
          Procedure:    Get_App_Role_List 
          Developer:      Ed Staffin 
          Date:           12/5/8
          Description:  GET  list of roles
       --------------------------------------------------------------------------- */ 
  
      BEGIN 
          sProcName := 'Get_App_Role_List'; 
          OPEN cData FOR 
          SELECT ROLE_CODE, ROLE_DESC
          FROM APP_ROLE
        WHERE APP_NAME = sAppName; 
                                                          
      EXCEPTION 
      WHEN OTHERS THEN 
          BEGIN 
            COMMON.COMMON_PKG.Log_Error(APPNAME, USER, SQLERRM, sProcName); 
            RAISE_APPLICATION_ERROR(ORAERROR, 'An error has occurred.  Please contact system support for resolution'); 
          END; 
  END Get_App_Role_List;           
by edstaffin
Tue 27 Apr 2010 18:17
Forum: LinqConnect (LINQ to SQL support)
Topic: database explorer
Replies: 1
Views: 1554

database explorer

I accidentally closed the database explorer and now I can't figure out how to reopen it. Help!
Thanks ... Ed
by edstaffin
Tue 28 Jul 2009 18:24
Forum: LinqConnect (LINQ to SQL support)
Topic: CLOB support
Replies: 1
Views: 2158

CLOB support

Does your linq to sql implementation support Oracle CLOBs?
THanks ... Ed
by edstaffin
Tue 28 Jul 2009 17:45
Forum: LinqConnect (LINQ to SQL support)
Topic: How to generate case insensitive LIKE comparision with LINQ?
Replies: 22
Views: 27919

Another possible alternative

How about just using
from m in PPCustomer.Mailings
where m.Subject.ToUpper.Contains(Cstr("test")).ToUpper
select m
?
by edstaffin
Tue 28 Jul 2009 17:34
Forum: LinqConnect (LINQ to SQL support)
Topic: Yat another simple query that doesn't work
Replies: 1
Views: 2257

Yat another simple query that doesn't work

I'm beginning to wonder if this product really works at all.
I create the simplest of queries:
Dim db As New MyDataContext
Dim qry = From item In db.Staffs Select p

based on a 1 table oracle database.

It won't compile complaining about:

Expression of type 'Devart.Data.Linq.Table(Of MyContext.MyStaff)' is not queryable. Make sure you are not missing an assembly reference and/or namespace import for the LINQ provider.

Any ideas?
Thanks ... Ed
by edstaffin
Mon 27 Jul 2009 15:02
Forum: LinqConnect (LINQ to SQL support)
Topic: How to generate case insensitive LIKE comparision with LINQ?
Replies: 22
Views: 27919

How about SqlMethods.Like?

Is this or will this be supported?
by edstaffin
Thu 23 Jul 2009 19:38
Forum: LinqConnect (LINQ to SQL support)
Topic: Simple query issue
Replies: 3
Views: 2213

So, does this mean it's a bug?
Geez, I've written a grand total of one query and it doesn't work.
Spooky.
by edstaffin
Thu 23 Jul 2009 13:43
Forum: LinqConnect (LINQ to SQL support)
Topic: Simple query issue
Replies: 3
Views: 2213

Simple query issue

Hi,
I am just evaluating the Linq capabilities of your product.
I ran the following query and it runs fine:

Dim qry = From u In db.Staffs Join c In db.Cost_Centers On u.Cost_Center_Seq Equals c.Cost_Center_Seq _
Order By u.Last_Name _
Select New With {.FullName = u.Last_Name & ", " & u.First_Name & c.Cost_Center_Seq, _
u.Staff_Seq}

However, I notice that I wanted a " - " in between Last_Name and Cost_Center.

So, I simply modified the query to say :
Dim qry = From u In db.Staffs Join c In db.Cost_Centers On u.Cost_Center_Seq Equals c.Cost_Center_Seq _
Order By u.Last_Name _
Select New With {.FullName = u.Last_Name & ", " & u.First_Name & " - " & c.Cost_Center_Seq, _
u.Staff_Seq}


When I ran the query I got the following error message:

The method is not supported with specified arguments.


Any ideas?

Thanks ... Ed
by edstaffin
Wed 15 Oct 2008 15:54
Forum: dotConnect for Oracle
Topic: In clause
Replies: 9
Views: 5310

What about the rest of my question?
by edstaffin
Tue 14 Oct 2008 17:40
Forum: dotConnect for Oracle
Topic: In clause
Replies: 9
Views: 5310

In clause

In normal linq2sql I can create an in clause using syntax similar to:
Dim qry = From x In db.YourTable Where (From y In _
db.Table2 Where y.field = 123 _
Select y.field).Contains(x.field) _
Select New With {x.field}

However when I try something similar to this using your product I get the following error:

"Method 'CompareObjectEqual' has no supported translation to SQL."

Do you no support this?
Also, do you now or will you be supporting the SqlMethods object calls? In particular, I am interested in SqlMethods.Like().
Thanks ... Ed
by edstaffin
Tue 14 Oct 2008 10:45
Forum: dotConnect for Oracle
Topic: OraDirect .NET and TransactionScope
Replies: 7
Views: 4979

Sounds good. Do you have a timeline for when 5.0 is likely to be available?
Thanks ... Ed
by edstaffin
Mon 13 Oct 2008 13:27
Forum: dotConnect for Oracle
Topic: OraDirect .NET and TransactionScope
Replies: 7
Views: 4979

Need to know

If there is no support for TransactionScope, what is the recommended way of doing transactions with this product?
Thanks ... Ed