Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 102121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T00:54:09+00:00 2026-05-11T00:54:09+00:00

var insInvoice = new NpgsqlCommand( @INSERT INTO invoice_detail( invoice_id, invoice_detail_id, product_id, qty, price, amount)

  • 0
var insInvoice = new NpgsqlCommand(     @'INSERT INTO invoice_detail(     invoice_id,     invoice_detail_id,     product_id,     qty,     price,     amount)     VALUES (     :_invoice_id,     :_invoice_detail_id,     :_product_id,     :_qty,     :_price,     :_qty * :_price)', c);   with(var p = insInvoice.Parameters) {     p.Add('_invoice_id', NpgsqlDbType.Uuid, 0, 'invoice_id');     p.Add('_invoice_detail_id', NpgsqlDbType.Uuid, 0, 'invoice_detail_id');     p.Add('_product_id', NpgsqlDbType.Uuid, 0, 'product_id');     p.Add('_qty', NpgsqlDbType.Integer, 0, 'qty');     p.Add('_price', NpgsqlDbType.Numeric, 0, 'price'); } 

kludge:  for(var p = insInvoice.Parameters; false;) {            p.Add('_invoice_id', NpgsqlDbType.Uuid, 0, 'invoice_id');     p.Add('_invoice_detail_id', NpgsqlDbType.Uuid, 0, 'invoice_detail_id');     p.Add('_product_id', NpgsqlDbType.Uuid, 0, 'product_id');     p.Add('_qty', NpgsqlDbType.Integer, 0, 'qty');     p.Add('_price', NpgsqlDbType.Numeric, 0, 'price');       } 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T00:54:10+00:00Added an answer on May 11, 2026 at 12:54 am

    As you’ve got an ‘Add’ method with the right form, you can use a collection initialiser for the parameters:

    var insInvoice = new NpgsqlCommand(sql) {     Parameters =      {         { '_invoice_id', NpgsqlDbType.Uuid, 0, 'invoice_id' },         { '_invoice_detail_id', NpgsqlDbType.Uuid, 0, 'invoice_detail_id' },         { '_qty', NpgsqlDbType.Integer, 0, 'qty' },         { '_price', NpgsqlDbType.Numeric, 0, 'price' }     } }; 

    For more on object and collection initializers, you can download chapter 8 of C# in Depth for free.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

var ref1 = new Firebase(http://gamma.firebase.com/myuser/123,456); ref1.set(123,456); var on1 = ref1.on(value, function(snapshot) { console.log(snapshot.val()); });
var queueitem = context.CrawlerQueues. Select(cq => new{cq.Guid,cq.Result}). SingleOrDefault(cq => cq.Guid == guid); Is above
var REGEX = new RegExp((?=[hms])g) var TIME = _GET('t', '0').split(REGEX) var hours = TIME[TIME.indexOf('h')-1]
var y = new w(); var x = y.z; y.z= function() { doOneThing(); x();
var fsw = new FileSystemWatcher(sPath, *.PPF); fsw.NotifyFilter = NotifyFilters.FileName; fsw.IncludeSubdirectories = true; fsw.Created +=
var request = new Request({ method: 'get', url: 'onlinestatusoutput.html.php', onComplete:function(response) { $('ajax-content').get('tween', {property: 'opacity',
var conversations = new Array(); jQuery('.CChatWindow').each(function(){ if (jQuery(this).is(:visible) && jQuery(this).attr(data-conversationid) != 0) { alert(jQuery(this).attr(data-conversationid));
var chart; var d = new Array(); function click() { d = document.getElementById('graph:hi').value; alert(d);
var parser = new DOMParser(), d = parser.parseFromString('<?xml version=1.0?><div class=a>Hello</div>', 'application/xhtml+xml'); console.log(d.querySelector('*')); console.log(d.querySelector('div')); console.log(d.querySelector('div.a'));
var bk = new Bookmark(); bk.link=blink; bk.title=btitle; bk.tags=[11,22]; for(var i=0;i<20;i++) { bks.push(bk);} chrome.storage.sync.set({bookmarks:bks}); I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.