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
  1. Home
  2. Web Development
  3. ASP.NET
  4. Database Error

Database Error

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netdatabasebusinesssales
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tash18
    wrote on last edited by
    #1

    Hi, I have developed an ASP.net VB application on 1.1 in which we insert certain data into a particular table which is on sybase. My table structure: CREATE TABLE dbo.at_ip_disbursement ( doc_id numeric(7,0) IDENTITY, doc_type varchar(30) NOT NULL, rim_no int NOT NULL, item_type varchar(80) NULL, customer_name varchar(80) NOT NULL, rsm_name varchar(80) NOT NULL, branch_no int NULL, business_unit varchar(30) NOT NULL, input_dt datetime NOT NULL, Category varchar(30) NULL, deferral_details nvarchar(600) NULL, days_deferred int NULL, Deff_Expdt datetime NOT NULL, Deferred_Dt datetime NULL, rm_comments nvarchar(600) NULL, creator_id varchar(10) NULL, modifier_id varchar(10) NULL, status char(1) NOT NULL, App_Authority nvarchar(600) NULL ) LOCK ALLPAGES go IF OBJECT_ID('dbo.at_ip_disbursement') IS NOT NULL PRINT '<<< CREATED TABLE dbo.at_ip_disbursement >>>' ELSE PRINT '<<< FAILED CREATING TABLE dbo.at_ip_disbursement >>>' go Now the piece of code where the insert takes place:

    Public Shared Function AddDisbursement(ByVal DocType As String, ByVal Rim As Int32, ByVal CustomerName As String, ByVal RSMName As String, ByVal BranchNo As Int32, ByVal Business As String, ByVal InputDate As String, ByVal Category As String, ByVal DeferralDetails As String, ByVal DeferredDays As String, ByVal DefExpDate As String, ByVal DefDate As String, ByVal RMComments As String, ByVal CreatorId As String, ByVal App_Authority As String, ByVal Item As String) As String
    Dim logger As SKLogger = New SKLogger
    Dim connMosaic As String = System.Web.HttpContext.Current.Session("connStr").ToString()
    Dim cmdText As String

        cmdText = "INSERT INTO at\_ip\_disbursement(" & \_
                    "doc\_type, " & \_
                    "rim\_no, " & \_
                    "customer\_name, " & \_
                    "rsm\_name, " & \_
                    "branch\_no, " & \_
                    "business\_unit, " & \_
                    "input\_dt, " & \_
                    "Category, " & \_
                    "deferral\_details, " & \_
                    "days\_deferred, " & \_
                    "Deff\_Expdt, " & \_
                    "Deferred\_Dt, " & \_
                    "rm\_comments, " & \_
    
    J 1 Reply Last reply
    0
    • T Tash18

      Hi, I have developed an ASP.net VB application on 1.1 in which we insert certain data into a particular table which is on sybase. My table structure: CREATE TABLE dbo.at_ip_disbursement ( doc_id numeric(7,0) IDENTITY, doc_type varchar(30) NOT NULL, rim_no int NOT NULL, item_type varchar(80) NULL, customer_name varchar(80) NOT NULL, rsm_name varchar(80) NOT NULL, branch_no int NULL, business_unit varchar(30) NOT NULL, input_dt datetime NOT NULL, Category varchar(30) NULL, deferral_details nvarchar(600) NULL, days_deferred int NULL, Deff_Expdt datetime NOT NULL, Deferred_Dt datetime NULL, rm_comments nvarchar(600) NULL, creator_id varchar(10) NULL, modifier_id varchar(10) NULL, status char(1) NOT NULL, App_Authority nvarchar(600) NULL ) LOCK ALLPAGES go IF OBJECT_ID('dbo.at_ip_disbursement') IS NOT NULL PRINT '<<< CREATED TABLE dbo.at_ip_disbursement >>>' ELSE PRINT '<<< FAILED CREATING TABLE dbo.at_ip_disbursement >>>' go Now the piece of code where the insert takes place:

      Public Shared Function AddDisbursement(ByVal DocType As String, ByVal Rim As Int32, ByVal CustomerName As String, ByVal RSMName As String, ByVal BranchNo As Int32, ByVal Business As String, ByVal InputDate As String, ByVal Category As String, ByVal DeferralDetails As String, ByVal DeferredDays As String, ByVal DefExpDate As String, ByVal DefDate As String, ByVal RMComments As String, ByVal CreatorId As String, ByVal App_Authority As String, ByVal Item As String) As String
      Dim logger As SKLogger = New SKLogger
      Dim connMosaic As String = System.Web.HttpContext.Current.Session("connStr").ToString()
      Dim cmdText As String

          cmdText = "INSERT INTO at\_ip\_disbursement(" & \_
                      "doc\_type, " & \_
                      "rim\_no, " & \_
                      "customer\_name, " & \_
                      "rsm\_name, " & \_
                      "branch\_no, " & \_
                      "business\_unit, " & \_
                      "input\_dt, " & \_
                      "Category, " & \_
                      "deferral\_details, " & \_
                      "days\_deferred, " & \_
                      "Deff\_Expdt, " & \_
                      "Deferred\_Dt, " & \_
                      "rm\_comments, " & \_
      
      J Offline
      J Offline
      jkirkerx
      wrote on last edited by
      #2

      <> wrote:

      cmd.Parameters.Add("@App_Authority", OdbcType.VarChar, 1200).Value = GetNull(App_Authority)

      Above is varchar, but in the table, you made it nvarchar, It's a mismatch, that involves unicode I think, in which one is double the space of the other, varchar is a 8bit codepage [edit] adjust your column in the table to take 1200 or whatever the value is suppose to be or vice versus

      App_Authority varchar(1200) NULL

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

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