sql - Error with nvarchar? -
i have created database error annoyed me , have tried every trick keeps coming back. works fine when add row or delete 1 one of tables don't rows when put n before dollarprice ok again when make changes tables same error occurs again have remove n works again. it's frustrating please help??? code below...
dim cmd new sqlcommand("with tbl (select isnull(sum(case when paytype = 2 , currencytype = 1 " + "totalprice end), 0) [purchasetotald]," + "isnull(sum(case when paytype = 2 , currencytype = 2 " + "totalprice / n'" & dollarprice & "' end), 0) [purchasetotalid]," + "(select isnull(sum(case when currencytype = 1 amount end), 0) paycompany) [paycompanytotald]," + "(select isnull(sum(case when currencytype = 2 " + "amount / n'" & dollarprice & "' end), 0) paycompany) [paycompanytotalid]," + "(select isnull(sum(case when currencytype = 1 amount end), 0) expenses) [expensestotald]," + "(select isnull(sum(case when currencytype = 2 " + "amount / n'" & dollarprice & "' end), 0) expenses) [expensestotalid]," + "(select isnull(sum(case when paytype = 2 , currencytype = 1 totaldiscount end), 0) cashier) [cashiertotald]," + "(select isnull(sum(case when paytype = 2 , currencytype = 2 " + "totaldiscount / n'" & dollarprice & "' end), 0) cashier) [cashiertotalid]," + "(select isnull(sum(case when currencytype = 1 amount end), 0) paycashier) [paycashiertotald]," + "(select isnull(sum(case when currencytype = 2 " + "amount / n'" & dollarprice & "' end), 0) paycashier) [paycashiertotalid]," + "(select isnull(sum(case when currencytype = 1 paidmoney end), 0) installments) [installmentstotald]," + "(select isnull(sum(case when currencytype = 2 " + "paidmoney / n'" & dollarprice & "' end), 0) installments) [installmentstotalid] purchase)" + "(select (cashiertotald + cashiertotalid + paycashiertotald + paycashiertotalid + installmentstotald + installmentstotalid) - " + "(purchasetotald + purchasetotalid + paycompanytotald + paycompanytotalid + expensestotald + expensestotalid) [purse] tbl)", con) dim da = new sqldataadapter(cmd11) dim dt = new datatable da.fill(dt) pursetb.text = "$" & formatnumber(dt.rows(0).item("purse"), 3)
Comments
Post a Comment