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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
P

ps0f0r

@ps0f0r
About
Posts
1
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • SQL Application - stuck on the way I should update my Table
    P ps0f0r

    Greetings! My name is Christos and I come from greece, happy to mmet you all! Anyways, I should start describing my problem. We use an ERP program in conjuction with SQL server and lots of tables that keep track of product records customers and all these kinds of stuff. I am building a fairly simple Warehouse Inventory Application. I have created a custom Inventory table that I would populate with records like {stock_code, Description, Quantity_remain, quantity_avail}. Those records already exist in 2 different tables in my database. The aim is that I want my program to fetch daily 10 random codes from those 2 tables bringing together the "columns" that my new custom table has +2 more editable columns: inventory, date, user with a query like this: select top 10 stck.code, stck.descr, stck.active, stck.group_code, stck.categ_code, stck_x_th.xwr_code, stck_x_th.thesi_code, stck_x_th.quant_remain from stck left outer join stck_x_th on stck.code = stck_x_th.stck_code order by newid(), I use the the stck table to fetch product info like its code,description,group_code,categ_code, and then I outer join the stck_x_th that contains records concerning quantities remaining or available asociated with each code and "places" those quantities reside. (those exact same columns are the ones my custom inventory table has) store them in a datagridview control, with only one editable column -inventory-, and then when the user fills out the inventory quantites, I want to save the datagrid "as it is" in my new custom table. I am creating a databound gridview control using one table adapter (which refers to the inventory table). Then I populate my table adapter using the forementioned query with a fillby method to populate the Datagrid (and therefore my Table in SQL) with the exact same values my query returned from the different tables. But whenever I try to update the table concurrency exceptions raise. It works like a charm if I enter the values in the grid cells manually my self but not if I populate the grid via a query and then hit update. Any suggestions please? I would appreciate it if you could bother posting some sample code. Thanks in Advance

    Database database help css sql-server sysadmin
  • Login

  • Don't have an account? Register

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