.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to update table where id needed to be read through from another table.

Posted By:      Posted Date: October 08, 2010    Points: 0   Category :ASP.Net


I have update statement.

student (NOLOCK) ON student.ID = SPECT.ID
ON CLSS.GID = student.GID
WHERE student.PID =  '20201'
AND CLSS.PID = '20201'

However, student.PID  and ClSS.PID need dynamically reach through from table CLSS to get each row of PID.

Here my table CLSS

Rowid  Username    PID        gid         nit       sid      NEWSID
7          cc                20201    00        1           AA       XX

8          cc                20201    02        1           SS       AA

9          dd              11000     0N &n

View Complete Post

More Related Resource Links

How to read Excel table?


If I  use Microsoft.Jet.OLEDB.4.0 to retreive for example named range or sheet from Excel and use it as data source for some server control on the ASP page, everything works fine. But when I try to get table from Excel like this: "select * from [Table1]", debugger complains that database engine could not find object Table1. So how should I reference Table1 in Excel file so that the database engine could find it?

execute update timedout expires , table with trigger due to recovery of database


I have table A in database A  , in table A i have trigger to insert record to database B table A, each update and insert of database A -table A, triiger fire and insert record in database B table A, when i try to update some times asp.net application gives error

"Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding."

and then error log says System.Data.SqlClient.SqlException: Database 'database B is being recovered. Waiting until recovery is finished.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean ret

Can't perform Create, Update or Delete operations on 'Table(outbox)' because it has no primary ke



I'm a beginner in asp.net and I have some problem inserting data into sql server 2005 with linq.


my code is : 


        Dim Result As New SMS.SendResult
        If Result.status = 0 Then
            Label1.Text = "Your Message Sent Successfuly"
            Dim db As New IGSSDataContext
            Dim out As New outbox With {.ClientID = intRandomNumber, .From = User.Identity.Name, .TO = TextBox1.TabIndex, _
            .Time = Now, .Message = Message}
            out.ID = (ID)
            TextBox1.Text = ""

update data on table

i have  100000 record  found in the  tha table and  i want  to update the column SocialState when found male he replace  the text male to 1 and when foun Female  he replace the text to 2   update [Drugs].[db_accessadmin].[Data] set SocialState='1' where SocialState='Male' update [Drugs].[db_accessadmin].[Data] set SocialState='2' where SocialState='FeMale' he give me this message "(0 row(s) affected)"

Update an accumlating shapshot fact table

This is my first time implmenting an accumulating snapshot fact table and I require some guidance. Accumulating snapshot fact tables show the status at any given moment. It is useful to track items with certain life time, for example: status of order lines.eg everytime there is new piece of information about a particular purchase, we update the fact table record. We only insert a new record in the fact table when there is a new purchase requisition. What I really need to know is how best to handle the updates.  This really feels very similar to managing SCD-1's in dimension processing! Anyone able to advise? thanks in advance Here is a perfect example we can use  http://blog.oaktonsoftware.com/2007/03/accumulating-snapshot-use-accumulating.html Figure 1, below, shows an accumulating snapshot for the mortgage application process. The grain of this fact table is an application. Each application will be represented by a single row in the fact table. The major milestones are represented by multiple foreign key references to the Day dimension—the date of submission, the date approved by mortgage officer, the date all supporting documentation was complete, the date approved by an underwriter, and the date of closing.

How we Update DataContext's Table Implicitly in Linq using .Net 3.5..?

Hi All.. My problem is i am working on Linq,as we know to use any table in linq we have to drag and drop it on our datacontext's Designer File,and at run time we got its value,till here no any problem,main point is if any changes in respective data source's schema has made ,then on datacontext we will not get that changes,for it we have to change this datacontext manually by by again drag and drop,it will not happen implicitly when this changes has been made on the data source. so please tell me how i solve this problem so that datacontext change implicitly without any over head  using .net 3.5 . 

Linked server and sensitive to register name of table. Problem with UPDATE.

Hi All. I try to work with table with "sensitive to register" name through Linked Server (MSSQL 2005/2008) and get the problem with UPDATE statement. Reason: MSSQL generates UPDATE statement with "un-quoted" table name. With SELECT/INSERT/UPDATE - no any problems. ----- Linked Database Information: 1. Firebird 2.5 2. OLEDB Provider: IBProvider v3 3. Database dialect: 3 Metadata: CREATE GENERATOR "GEN_ID_TableWithMixName1"; CREATE TABLE "TableWithMixName1" ( TEST_ID INTEGER NOT NULL, "Col" VARCHAR(100), DUMMY_COL INTEGER, CONSTRAINT "PK_TableWithMixName1" PRIMARY KEY (TEST_ID) ); CREATE TRIGGER "BI_TableWithMixName1_TEST_ID" FOR "TableWithMixName1" BEFORE INSERT AS BEGIN IF(NEW."TEST_ID" IS NULL)THEN NEW."TEST_ID" =GEN_ID("GEN_ID_TableWithMixName1",1); END; ------- MSSQL Test 1. MSSQL: select * from IBP_TEST_FB25_D3_V3...TableWithMixName1; IBProvider: Command_Execute   SELECT "Tbl1002"."TEST_ID" "Col1004",         "Tbl1002"."Col" "Col1005",         "Tbl1002"."DUMMY_COL" "Col1006"   FROM "TableWithMixName1" "Tbl1002" No Problem ------- MSSQL Test 2. MSSQL: delete from IBP_TEST_FB25_D3_V3...Tabl

update table using web services

i want to update table using web service file, i am retriving value like this :[WebMethod]    public DataSet getinfo()    {        SqlConnection con = new SqlConnection(@"Data Source=WEBTECHNO1\WEBTECHNO;Initial Catalog=blogsite;Integrated Security=True");        SqlCommand cmd=new SqlCommand("select * from blogenter",con);        SqlDataAdapter da=new SqlDataAdapter(cmd);        DataSet ds=new DataSet();        da.Fill(ds);        return ds;    }anybody tell me how can i update table using this web service , what should return type in update and all these things...

update table with SSIS

  Hi, sorru for my english   I have two tables: intervenant: idInt (primary key) name login (foreign key) (accepting the null) compte: login (primary key) idInt (foreign key) I'd like to know how to do an UPDATE in the table "intervenant" once I filled the login field of the "compte" table.     thanks

Update producing invalid object name for temp table

If IWantThisDSN = 0 Then SQLString = "SELECT importparamsID, ESubmitType, Description, ImportFileName,ClientCode, Notes00, Notes01, Notes02, Notes03, Notes04 into #t0 from Importparams " Else SQLString = "SELECT importparamsID, ESubmitType, Description, ImportFileName, ClientCode, Notes00, Notes01, Notes02, Notes03, Notes04 into #t0 from Importparams " End If cn.Execute(SQLString) SQLString = "UPDATE #t0 Set Description = ' ' WHERE Description IS NULL" cn.Execute(SQLString) I'm getting the error in the last cn.Execute(SQLString) line...   Message=[Microsoft][SQL Server Native Client 10.0][SQL Server]Invalid object name '#t0'. I'm using VB 2010 and SQL Server 2008. This worked fine before with VB 6 and SQL Server 2000 but with the "upgrade" it's not working... If you need any more info let me know what I may have left out.  Thanks!


SqlCeCommand cmd = new SqlCeCommand(                         @"UPDATE Printed                           SET Printed.PrintedPages=@pages                           WHERE Registered.IdNumber = Printed.StudentID AND Printed.SemName = @semname", conn);                     SqlCeParameter param = new SqlCeParameter("@pages", totalPages);                     cmd.Parameters.Add(param);                     param = new SqlCeParameter("@semname", ((Semester)cmbBoxSemName.SelectedItem).ToString());                     cmd.Parameters.Add(param);               

Delete objects from table using another table to select rows - help needed

I have one table named 'dbo.ac_Products'Within this table there is a column named 'ProductId'There is also another table named 'dbo.ac_CatalogNodes'Within this table there is a column named 'CatalogNodeId'and a column named 'CatalogNodeType'I need to delete all the rows from 'dbo.ac_Products' and 'dbo.ac_CatalogNodes' where 'ProductId' = 'CatalogNodeId' and 'CatalogNodeType' = 1Any help would be greatly appreciated!

Update duplicate field in same table

  hi I have a table with some other duplicate field as below   IssueID Title A1 Test1 A1 Test2 A2 Test3 A2 Test4 A3 Test5 A4 Test6   i want update all duplicate field based on IssueID and the final result will show as below   IssueID Title A1 Test1 A1 Test1 A2 Test3 A2 Test3 A3 Test5 A4 Test6 may someone help me?  

Update a record in a table?

HiI've been playing around with MVC lately, and was wondering how you could do this:I have a view that displays a list of products, and against each product is a list of categories (in a combobox). I'm trying to find out how you can update a product's category when you select a category in the list. I know you could do something fairly simple with jQuery, but I'm trying to understand how submitting forms works with MVC.Here's what I currently have:// Controller public ActionResult Index() { List<Product> products = _productRepository.GetProducts(); List<ProductCategory> categories = _productRepository.GetCategories(); ProductsViewModel viewModel = new ProductsViewModel { Products = products, ProductCategories = new SelectList(categories, "Id", "Description") }; return View(viewModel); } // ViewModel public class ProductsViewModel { public List<Product> Products { get; set; } public SelectList ProductCategories { get; set; } } // View <% using (Html.BeginForm()) { %> <table> <tr> <th>Id</th> <th>Description</th> <th>Category</th> </tr> <% foreach (var product in Model.Products) { %> <tr> <td><%: product.Id%></td> <td><%:

Table popup control needed

Hi i got a Html table with Database names displayed in it , now when i hover overthen the need to display images with the path is also saved in the database , so i would have to add some asp.net control in the HTML Table  ,  No Javascript , i have tried it and when i search for names in the database the pics in the table are not where they belong . Need asp.The names are displayed via int howmany=0;while(read.Read()){howmany++;ShowinTable(read["Code"].ToString(),howmany);}Thanks any for suggetions.

SQL Checking the table before insert or update

I need your help with a SQL Stored Procedure PLEASE!!!GOAL: I need to check TableA for the ItemID if the ItemID Is Not found Insert a new record. If the ItemID Is found Update existing record.***********************Below is Incorrect***********************Please HELP!!!!IF @ItemID is not null          Set NewRecord =  Select ItemID FROM ContentItems Where EXISTS  (select ItemID from ContentForm_Fields where ItemID=@ItemID)IF NewRecord is not null   Update ContentForm_FieldsELSE Insert ContentForm_Fields

How to read records in a table one by one?

hi friends, i have briding table that holds userid and roleids, i was given the user_id to get all the role_id s that this user has. i could do a select statement with a where clause. select role_id from UserRoles where user_id = 28 this returns a list of the role_id, But how do read each row returned by the above statement so that i could insert each row to another (virtual) table? thanks          
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend