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

While inserting data from one table to another table getting error
combining Month Name with the Day SQL Server
Passing parameter variable in exec() function in procedure
Do i need ROWLOCK in addition to (UPDLOCK, READPAST) hints?
Search multiple tables with a single search criteria in Sql Server
Adding permissions for NT AUTHORITY\NETWORKSERVICE
How could I get “String or binary data would be truncated” when the value being updated is not too long?
SSRS: Recursive Parent Child
Multiplication issue in sql server 2012
Tracking deletes on SQL Server
I want optimized query in SQL Server 2012
Creating and Running a SQL Server Unit Test Visual Studio 2015
Connecting SQL Server to online?
Use SSRS exported Excel as SSIS Excel Destination?
How to create a Database user in Entity Framework
What is the proper use of a clustered index?

Categories

HOME
jdbc
ember.js
sidekiq
jenkins-plugins
erlang
payment-gateway
bing
tomcat7
is-empty
appmaker
java-home
octopus-deploy
game-maker-studio-1.4
activesync
store
postmessage
rapidjson
jquery-terminal
apache-karaf
session-timeout
grub2
eclipselink
styles
go-cd
jflex
excel-2013
chrome-native-messaging
reactiveui
vertex-buffer
superscript
salesforce-chatter
windows-10-iot-core
geomesa
pace
bing-maps-api
redhat-datavirt
zero
android-download-manager
dql
equivalence
nashorn
stereo-3d
service-fabric-stateful
finite-element-analysis
dojox.grid.datagrid
tuleap
sgmlreader
castle-dynamicproxy
redux-router
bettercms
atlassian-crowd
sql-server-administration
coremidi
c#-interactive
picasa
debugdiag
webkit2
boost-hana
database-backups
image-editing
spatial-query
asp.net-mvc-2
xmp
handlebars.java
programming-paradigms
findcontrol
apache-mina
web-component-tester
git-checkout
hana-xs
cloudpebble
genetic-programming
java-collections-api
ember-addon
lumx
factors
bounds
cling
magicalrecord-2.2
fogbugz-api
goinstant
qt4.6
wpdb
icefaces-3
hibernate3
datacontract
adsl
ets
symbol-server
requestfactory
yajl
external-assemblies
aio
windows-controls
lazy-c++
internals
method-signature
dirty-data
ajaxpro
visual-studio-dbpro

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