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

How do I map my connection string to my app_data folder rather than use an absolute path?
UPDATE slow when setting column to NULL
Two sorted subqueries into one result
How to join table from one database with view from another database in SQL Server
Generate a script of inserts from existing data with a select clause in SQL Server
Unable to add database reference for dacpac in Visual Studio 2012 - OutOfMemoryException
App Pool User Unable to Execute Stored Procedure
undocumented CONVERT styles - datetime 23
Create custom predicate function in T-SQL?
Procedure calling other procedure in t-sql
radius search by latitude / longitude
Table value type in SQL Server 2008
What is the equivalent of Oracle's LAST_DAY() function in SQL Server 2008?
On report developing using SQL Server Reporting MS SQL Server 2008
Skip Column in OPENROWSET (BULK)
Challenging recursive T-SQL query

Categories

HOME
sql-server-2008
meshlab
dynamics-crm
bower
jbehave
json-ld
bibtex
propertygrid
devstack
triggers
google-spreadsheet-api
pca
android-viewpager
ipfs
ndis
cpanel
phoenix
event-log
primes
ejbca
aws-cognito
multiplayer
novnc
java-ee-7
hanami
branch
positioning
sharp
exponential
preg-grep
ifstream
salesforce-chatter
pmwiki
equivalence
alchemy.js
android-preferences
productivity
cppunit
lumen-5.3
aqgridview
istorage
jgraph
slidesjs
google-maps-ios
rpostgresql
pdfkit
efxclipse
chessboard.js
json-schema-validator
gameanalytics
foxit
coordinate-transformation
date-format
proxygen
amazon-kcl
qt-linguist
drf-nested-routers
jta
sourcegear-vault
pyopengl
es2015
cloudpebble
dmp
outline
power-law
hamsterdb
document-database
threadx
resgen
mailcore
soa-suite
magickwand
sametime
mozart-mvc
attachevent
ubuntu-11.10
qsqltablemodel
symfony-2.0
tfs-power-tools
plone-funnelweb
rose-db-object
isolatedstorage
entity-framework-ctp5
nintendo
nssavepanel
electronic-signature
associative
symbol-server
hardware-acceleration
sitemappath
quick-search
surefire
lazy-c++
evb
msf

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