Is there an easier way to insert the values contained in a data table generated in ASP into a SQL table without having to loop through all the rows in the data table and insert individually into the SQL table?
thanks for any help!
View Complete Post
When a user starts a membership using the Create User wizard supplied by the aspnetdb profile service, I need to add a field to a table in aspnetdb and upon clicking the ContinueButtonClick insert some data. The field I'll add is "SubscId". My first question is what table is best for this - Users or Membership?
Secondly, what is the best way to insert new data for this scenario? code behind? markup? Can someone provide basic syntax of insert code in code behind for this scenario?
I need to implement a logic where in I insert or update a table in a loop.If the record is inserted then I need to update the table.To check this I have given IF NOT EXISTS statement with a query. But IF NOT EXISTS always returns true, so many records are
getting inserted and update always fails
How do I resove this problem
What is the most efficient way of creating a 15 minute increment table. This table needs to continue to increment with time so its not a static table. While loop? how will that affect the performance, if I have to add dates starting 2005 till today and then
basically after that with every hour a value needs to be added.. How can I go about doing that?
I am using SQL 2008
If I create a data tabe in C# like so:
datatable t = new DataTable;
DataColum C1 = new DataColum;//ID column
//the same with column C2
Then I fill up the table with some data.
Then the goal is to either insert this data or update data in an SQLtable in SQL. If the data is inserted, the ID column in t would be empty, if updated, it would not be. So in the insertion case, the sql query needs to make sure that unique IDs are assigned during insertion, in the update case, it just has to look for the right IDs.
How to go about this?
Asking because I am only familiar with updating and inserting single lines into a table. One could loop in C# over the datatable t of course and insert or update line by line, but this would probably be slow. Is there a way to write an SQL query like this somehow:
Insert Into SQLTable Values (@t)
And Update like this:
Update SQLTable SET ... Where C1 = @t.C1
Or something like that.
I know that SQL server can create automatic update and insert queries and that you can then type things in C# like
But, this has proven to be super slow on our server, for unknown reasons. I have asked on this forum and got some answers from experts, but was not able to srot out the problem.
How can we write
I have a data view web part that inserts a new record into a sql table. This works fine.
I have now needed to add a trigger to the sql table that sends an email when a new record is inserted (the code for which works fine) but now my insert fails with 'The data source control failed to execute the insert command.'.
If I disable the trigger the form works fine again.
Any ideas what could be causing this?
I have a data table that contains some values for Certifications. This table can be updated in a different part of my application. On the web page I am currently working on, I would like to have check boxes appear for every value in the data table. I have been struggling with this trying to use a For Each loop and I cannot get it to work for anything. Any suggestions?
I am using the following Razor syntax to obtain my data (I know this works because I can display it in a WebGrid):
var db = Database.Open("MyConn");
I need to know how to show top 30 records from four table
with fastest speed.. in ms sql server 2005..
hope You do the needfull
Julie Lerman shows database administrators how to limit access to databases from the Entity Framework by allowing it to work only with views and stored procedures instead of tables-without impacting application code or alienating developers.
MSDN Magazine August 2010
Let go of your traditional relational database thinking if you want to understand how Windows Azure Table storage works, says Julie Lerman. Luckily for you, she's done the hard work to grasp the new concepts and help you get up to speed.
MSDN Magazine July 2010
In this article, the author shows you three new arrivals on the SQL Server spatial visualization scene: the map control in SQL Server 2008 R2 Reporting Services (SSRS), the ESRI MapIt product, and the MapPoint Add-In for SQL Server 2008.
MSDN Magazine November 2009
In this article, the author delves into some commonly used ways of writing data access code and looks at the effect they can have on performance.
MSDN Magazine August 2009
New spatial data support in SQL Server 2008 opens the door to mapping and querying geometric and geographic data, allowing you to build exciting new applications.
MSDN Magazine February 2009
In T-SQL, views and derived tables serve similar purposes and have their advantages. But when working with SQL Server 2005,there's a third option--using Common Table Expressions (CTEs). John Papa explains.
MSDN Magazine October 2007
I have a table like this in database
ItemNo ItemName Qty
001 A 50
002 A 20
003 B 50
004 C 60
005 D 40
006 E 90
upto it has some 3000 rows in table..
Now what my problem is i have one more field in mydevelopment PC let us consider another column Category
I need to update this column to my client pc without losing 3000 data from table which already exist...
How to do...?