.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 get the difference between TFS code that has been checked in and the database

Posted By:      Posted Date: September 18, 2010    Points: 0   Category :Sql Server
Hi all,  I did a project and checked in all the code in visual studio team foundation server and deployed on a server.Later i have checked in few more sql files in visual studio team foundation.now i want to get the files from visual studio which are not been deployed on my Database server. I want the difference between my VSTF code and my Databases.   Thanks in Advance!!

View Complete Post

More Related Resource Links

Can this code be setup to run against the whole database instead of just 1 record at a time?


We have made some changes to this code to start capturing 1 new field of data and updating it as new records are added. But there is currently about 120,000 records more or less.. those records of course dont have the new field populated with anything..

We would like to run this logic that already in place and run it against the tables to update the fields 1 time. I think to make it easier, if it can be setup to expect the "valueTwo" variable, so that we can run it againt the individual codes instead of doing all the records at one time.. there are codes that only have a few records, so it would be best to test initially against the small code group.


            strSqual = "insert into trans (trans_type_name, trans_date,sys_id,mod_user_id,show_ind, remoteCode, techName) values('" & valueTwo & "','" & TransDate & "',"&strSystemID&", 1,'T', '" & dbQuote(strUser) & "', '" & strTechName & "')"        
            'get the new transaction_id out for just inserted alarm   
            strSqual = "select max(transaction_id) as transaction_id from trans"  
            set rst = getStaticRecordSet(strSqual)

Create/add table from code to database



I create table:

                  DataSet data=new DataSet();

                  DataTable myTable = new DataTable("NewTable");

                   DataColumn[] keys = new DataColumn[1];

                   // create column
                   keys[0] = new DataColumn();
                   keys[0].DataType = System.Type.GetType("System.String");
                   keys[0].ColumnName = "PointID";
                   myTable.Columns.Add(keys[0]);    &nb

Under the Table: How Data Access Code Affects Database Performance


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.

Bob Beauchemin

MSDN Magazine August 2009

Toolbox: Database Audit Logs, Joel on Software, Code Handouts, and More


This month the Toolbox column takes a look at database logging, Joel Spolsky's blog, printing code projects, and ASP.NET reading.

Scott Mitchell

MSDN Magazine May 2008

Protect It: Safeguard Database Connection Strings and Other Sensitive Settings in Your Code


Protecting application secrets, such as database connection strings and passwords, requires careful consideration of a number of pertinent factors such as how sensitive the data is, who could gain access to it, how to balance security, performance, and maintainability, and so forth. This article explains the fundamentals of data protection and compares a variety of techniques that can be used to protect application settings. The author discusses what to avoid, such as hiding keys in source code and the use of Local Security Authority. In addition, he presents some effective solutions such as the Data Protection API.

Alek Davis

MSDN Magazine November 2003

Wicked Code: Supporting Database Cache Dependencies in ASP.NET


Developers love the ASP. NET application cache. One reason they love it is that ASP. NET lets them create dependencies between items placed in the cache and files in the file system. If a file targeted by a dependency changes, ASP.

Jeff Prosise

MSDN Magazine April 2003

How to set the checkbox state "checked or not checked" from a database


hey In the code I have here, I need to set the checkbox state from a database but I dont know the properties:

while (l_objRead.Read())
                         //txtUserName.Text = l_objRead["UserName"].ToString().Trim();
                         txtWerknemerNaam.Text = l_objRead["Naam"].ToString().Trim();
problem here => cbAktief.CheckState = l_objRead["Aktief"];

don't know how to set the state, help pleaz :)

Failed to initialize MSDB database for tuning (exit code: -1073741819). (DTAClient)

Hello,This is the first time I am using this forum. I am stuck and need some help. I received this error message both on SQL 2005 and 2008. I am currently using SQL 2008 DEV for testing purposes and I am experiencing this error message when trying to connect to Database Engine Tuning Advisor. I am using the SA account so I should not have any security issues. Also this is a fresh install of SQL 2008 DEV on a fresh install of Windows XP Pro with all SP. Can some please help.Error:"Failed to initialize MSDB database for tuning (exit code: -1073741819). (DTAClient)"=================================== Failed to open a new connection. =================================== Failed to initialize MSDB database for tuning (exit code: -1073741819). (DTAClient) ------------------------------Program Location:    at Microsoft.SqlServer.Management.DTA.Client.TuningServer.InitializeTuningParametersDatabase()   at Microsoft.SqlServer.Management.DTA.Client.TuningServer.InitializeConnection()   at Microsoft.SqlServer.Management.DTA.Client.TuningServer.Connect()   at Microsoft.SqlServer.Management.DTA.Shell.SessionMonitor.AddServerInternal(SqlConnectionInfo connectionInfo, SqlConnection connection)   at Microsoft.SqlServer.Management.DTA.Shell.SessionMonitor.AddServer(SqlConnectionInfo connectionInfo, SqlConnection connection)   at Microsoft.SqlServer.Management.DTA.Shell.SessionMonitor.On

Why is it that this code updates my sql database with the default EditBox text?

Any help is appreciated. using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using MySql.Data.MySqlClient; public partial class _Default : System.Web.UI.Page { TextBox EditBox = new TextBox(); TableRow[] NewRows = { new TableRow(), new TableRow() }; TableCell[] NewCells = { new TableCell(), new TableCell() }; string ID; protected void Page_Init(object sender, EventArgs e) { } protected void Page_Load(object sender, EventArgs e) { var Connection = new MySqlConnection("Server=localhost;Database=site;Username=root;Password=root"); var Command = new MySqlCommand("select * from news", Connection); Connection.Open(); var Reader = Command.ExecuteReader(); while (Reader.Read()) { ID = Reader.GetString("ID"); string Title = Reader.GetString("Title"); string Text = Reader.GetString("Text"); foreach (TableRow Row in NewRows) { NewsTable.Rows.Add(Row); } NewCells[0].Text = Title; NewCells[1].Text = Text; NewCells[0].Font.Bold = true; NewCells[0].Font.Underline = true; NewCells[0].Font.Size = Fon

Code to get details from joomla MYSQL database in godaddy

I want to write a basic code to connect to joomla MY SQL database. I am getting issues with connection string. Can any one help me out with sample code if you did such work before. A simple code which retrives records and displayes in webform is what I require.   Thanks in advance Chandra 

I am Getting error in Sqlcoding while using my code in remote Sql database.

HaiI am getting Error in this code. I mention my ERROR in BOLD Letter in my Coding.. And i show u the Connectionstring Too.BUt this code is working Perfectly in My local "Connectionstring"Plz Help Me to solve this error. Conn = New SqlConnection("Data Source=xxx.xxx.xxx.xx;Initial Catalog=xxxxxxxxxxxxx;Persist Security Info=True;User ID=xxxxxxxxxx;pwd=xxxxxxxx;MultipleActiveResultSets=True")If (Conn.State = ConnectionState.Closed) Then                Conn.Open() End If            ErrMsg = ""            StrQry = ""            StrQry = " select * from MO_users where({ fn LCASE(username) } = { fn LCASE('" & Username & "') }) " & _                      " and (CAST(password AS binary) = CAST('" & Password & "' AS binary)) and status='1'"            Cmd = New SqlCommand(StrQry, Conn)            Dr = Cmd.Execute

Difference between Last Processed and Last Schema updated in OLAP Database .

I have a OLAP database in my server.Today I processed the OLAP database using "Analysis Services Process task" using SSIS.After this, I  checked the properties of the OLAP database (AS-->Databases-->Corresponding Database->Right click --> Properties -->), in that , I can see the time is updated in the
1.Last Schema update   and
2.Last update.
    I dont find find any change in the "Last Processed" Time.?
Now I want to know the difference between 1.Last Schema update   2.Last update. and  3.Last Processed.
Your help would be greatly appreciated.

The difference between code behind and front side html



This is a basic understanding I miss, 

On our aspx page most actions can be done from code behind or from aspx.cs page 

If it is done from aspx.cs page then there is no access to the code , unlike Javascript, css or plain html, for example changing font color can be done both ways:

In code behind:  lblMessage.ForeColor = Drawing.Color.DarkRed

Or in html: style="font-family:verdana;color:DarkRed"

when should I be using code behind and when html?

If the only difference is privacy then why not using only code behind?

Multiple Images upload to SQL Database C# code help pls !



I have a web form where user can upload image and store to SQL database. (SQL tables has a relation like one title has multiple images fields).

Title: <asp:TextBox ID="txtTitle" runat="server" Width="300px"></asp:TextBox>

Image Name:<asp:TextBox ID="txtImage" runat="server" Width="200px"></asp:TextBox>

<asp:FileUpload ID="FileUpload1" runat="server" />
<asp:Button ID="btnSubmit" runat="server" Text="Submit Information" 
               onclick="btnSubmit_Click" />

aspx.cs code:

 protected void btnSubmit_Click(object sender, EventArgs e)
//to store image into sql database.
         string strImageName = txtImage.Text.ToString();      

                    if (FileUpload1.PostedFile != null &&
                    FileUpload1.PostedFile.FileName != "")
                           byte[] imageSize = new byte[FileUpload1.PostedFile.ContentLength];

Where to place code to update database using WPF in VS2010?


I have an app in WPF that has numerous controls that are bound to datatables that are filled from sqlserver.

I now need to add the code for updates, inserts and deletes

Where should I put the code to implement this?

I found code


._adapter.UpdateCommand.CommandText = "tool generated update command

in an auto-generated section of the source file that VS created it looks almost correct but I have never before seen an update statement with an order by clause.
I also found multiple instances of:
  if ((this .Adapter.UpdateCommand != null )) {
 this .Adapter.UpdateCommand.Connection = value ;             }
But I cannot find where value is defined or assigned
I have a tabbed interface with a selection list to move back and forth through the datatable. I want to update the data base with all changes to the current selection when a user changes selection or selects a different tab So what is the preferred method to initiate the update and where should

Difference between truncate and drop table on database fragmentation


I have a group of developers that are creating stored procedures, in them they are dropping a table and re-creating the table and then continuing with the processing.  My question is if there is any difference between the effect of dropping a table and truncating the table on database fragmentatiom.




Date from a database using code behind



I'm trying to rework some code I've found, and it's all now working except for the date (dbDate). I need to keep it as a date value (and not convert to string), but I can't get the code to work:

        using (conn)
                comm.Connection = conn;
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