sql-server


How to update a list of different data to a table in sql server?


I'm quite new to sql and I can't figure out how to do this query. I have a Table named Project_Pricing with these columns: Id, Project_ID, SourceCode, ServiceCode, TargetCode...
Each Project can be a lot of times in this table. In other words, each Project object has a List of Project_Pricings in it. I'm making a form with a ListBox that contains all the Services(ServiceCode) and the ones that this project has are pre-selected and the user can select multiple services and take away a few that were already there before and so on... I want to be able to update the Project_Pricing table with the new Services. How can I do that? Thanks.
This is part of my ProjectDetails View:
<td class="control-label">
<label class="dcl-control-label required">Addt'l Services:</label>
</td>
<td class="spacer-column"></td>
<td class="control-input">
#{ var services = Model.SelectedServices ?? new List<string>(); }
#Html.ListBoxFor(m => services, new MultiSelectList(Model.ServiceList, "ServiceCode", "ServiceCode", services), new {#class = "listbox"})
</td>
and part of my Project Model:
public IEnumerable<ProjectPricing> ProjectPricings { set; get; }

Related Links

Should the PK on an identity column (which is surrogate key) be non-clustered?
copy same records with Different ParentID from Existing ParentID
Use SQL Server LocalDB with multi user over local network
How to update record based on value of next record in SQL Server 2008
Conversion failed when converting date and/or time from character string
Delphi: What's wrong with REST API based on mORMot?
it is possible to backup sql server database in runtime
remove 1st item (or any item) form multivalued parameter item list in SSRS
Import multiple Excel files to create 1 table in SQL Server 2012
SQL Server Configuration Manager won't start: WMI returns error
how to write a t-sql master procedure to catch sub procedures raised error
rsDataSetExecutionError after stored procedure update
querying nvarchar fields in a table pauses part way through
sp_executesql date “Conversion failed when converting date and/or time from character string” in specific case
Select record over date range in SQL Server
TSQL to CAML Where value IN OTHER 2010 SP list

Categories

HOME
makefile
paypal
semantic-ui
admin-on-rest
tinyos
filterrific
scipy
raspbian
facebook-graph-api
concourse
phonegap-cli
phaser-framework
ext.net
eval
height
packer
rfid
ssr
wordpress-theming
xlsx
image-recognition
mongodb-query
gwtp
symfony-forms
riak
mule-studio
quartus
device-detection
android-fragmentactivity
backpropagation
os161
k2
nmf
badge
activepython
metis
superagent
vegan
rhino
remote-server
es-shell
delphi-10.1-berlin
pytest-django
rich-text-editor
number-theory
web-deployment-project
cgcontext
pluck
crash-reports
nuget-server
butterknife
python-hypothesis
date-range
gmt
qos
autoresize
windows-azure-pack
chessboard.js
dojox.charting
inotifypropertychanged
kendo-combobox
emokit
sun-codemodel
acm
difference
evo
abas
pyrocms
divide-by-zero
es2015
belongs-to
activity-streams
gmaps4rails
vcl
ember-components
ghostdoc
sthttprequest
alpha-transparency
valence
boost-test
codeigniter-a3m
help-viewer
real-time-updates
nsmatrix
onselect
visual-studio-2003
grunt-contrib-compass
iconv
zend-lucene
trailing-slash
android-4.0
pitch
deploying
gjs
signals2
handwriting
communicationexception
configurable

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App