.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

Compare data in a single column overtime

Posted By:      Posted Date: October 12, 2010    Points: 0   Category :Sql Server


I have the below sample table and is trying to compare the data accross time in the Account field. Basically if the Account field changed from NULL (default) it can not go back to NULL or change to another type. My goal is to list where the field value changed from Accept back to NULL or Reject back to NULL or Accept to Reject or Reject to Accept. NULL is the default value.



TABLE [dbo].[T2](

[ID] [smallint]


View Complete Post

More Related Resource Links

Best way to display data of a single column from a Sharepoint Custom List

I'm trying to create pages that will automatically populate with data pulled from a sharepoint list (like title, department, contact info, etc.).   I'm using publishing pages. What would be the easiest way to do this, and how would I specify which data to pull from the list? For example, the page would be set up like this: [Title:biology] [Department:biology] [Contact Info:biology]   and when the page loads, it would look like this: Biology Lab Biology Department 123-456-7890   I want it to just pull the data -- I don't want a list view or anything like that.  I need this page to look pretty, and I need the each column's data to show up in a very specific place. How could I make pages that would do that?

Rendering data with HTML tags in the DD Gridview for a selected column


I am having trouble finding out where and how to HTML Encode a cell's data on the Dynamic Data (v4.0) gridview of List.aspx.  As a simple case, suppose I have formatted cell data that is A<br/>B in the DB.    Obviously, I want A stacked on B in the cell.

It seems gridView1.HtmlEncode = true has gone away.

So maybe I'll try to catch it on the RowDataBound event:

protected void GridView1_RowDataBound(Object sender, GridViewRowEventArgs e)

            if (e.Row.RowType == DataControlRowType.DataRow)
                // Html Encode the cells


but this event never fires?

Has anyone figured out how to properly render HTML tags data in the List.aspx's GridView1? 

If I figure this out, then I can add a MetaAttribute called something like [EncodeAsHtml(true)] and be on my way.  Thanks!

Data Points: Column Expressions, DataRelations, and Computations


This month John Papa fields some of his favorite questions regarding data manipulation with ADO.NET.

John Papa

MSDN Magazine January 2007

split one data column into many?


Hi, I've a database table contains survey questions and answers. But the problem is both 'question' and 'answer' are saved in the same column(like below).

SubmissionDate                                                          Submission

2010-02-15 14:53:59.657                     ***What's your pet's name?***  Lili ***Tell us about yourself*** I'm a teacher

2010-02-15 14:53:59.657                     ***What's your pet's name?***  Lucy ***Tell us about yourself*** I'm a five star cook

I'd like to use a simple datagrid to display the survey result, but I need to separate the submission column into multiple columns ('question' as column name, 'answer' as data)

the number of questions or questions being asked are different for each survey so they are not fixed. 

Is it even possible to get something like this below in a gridview? 


Business Data Column cascade


Good afternoon, I would like to know if is possible to have two business data columns linked to each other. This is the scenario that I want:

BD Column 1 called State with all US states

BD Column 2 called City with all the cities based on the state selected on BD Column 1

Use BDC data in list as multi-select column

I have a document library that uses values from another system for its metadata.  Right now, we copy the values from the primary system into SharePoint so users can choose them.  I want to find a way to use the BDC connection that I have set up to automatically pull those values.  The problem is that the current metadata is set to multi-select.  So, I have a file that is in the library and it can be used for multiple clients - clients is a column in my library and users can select many entries.  When I set up a column to pull BDC data, it only allows single entry.  Does anyone have any ideas?

BDC Entity as a Data Source for a Lookup column

Is it possible to create a custom lookup field type to have a BDC entity as the data source?

Sharepoint list group by column data ,display in webcontrol like panel or label


I  have a sharepoint list[Managers] with groupby sector column. like below




Each Sector group by column data i want to display in label or panel control.

How to do that ? how to write the logic?



Regards, Mansoor

Using the single *.rpt file with multiple data sources


I've created a set of CrystalReports (*.rpt files) for an ASP.NET web app on a development server. I call each report using the following code:

protected void BTN_RunReport_Click(object sender, ImageClickEventArgs e)
CrystalReportViewer_ClientLetter.Visible = true;

ConnectionInfo con = new ConnectionInfo();
con.ServerName = Constants.ServerIP;
con.DatabaseName = Constants.DatabaseName;
con.UserID = Constants.UserID;
con.Password = Constants.Password;

CrystalReportViewer_ClientLetter.ReportSource = Server.MapPath(Constants.ClientLetters);
ParameterFields parameter = CrystalReportViewer_ClientLetter.ParameterFieldInfo;
ParameterField batchdate = new ParameterField();
batchdate.Name = "@BatchDate";
ParameterDiscreteValue batchdate_value = new ParameterDiscreteValue();
batchdate_value.Value = Convert.ToDateTime(txtBatchDate.Text);

foreach (TableLogOnInfo tlf in CrystalReportViewer_ClientLetter.LogOnInfo)
tlf.ConnectionInfo = con;

Hide data for specific column from a user

Greetings, I have a problem. I would like to restrict showing specific users (or roles or schemas) data in a column. First I thought DENY option will do it but figured out that it won't. DENY denies the column being in the SELECT query. I would still like to call the column but if access to the data in that column is restricted it would show only null values and not the real ones. So... I would like call the next query from user TestUser: SELECT ID,Name,Address FROM Employee But if access to Address is restricted for TestUser I would get results like: ID Name Address 1 John Smith NULL 2 Rick Ross NULL ... Is it possible to do something like that in SQL Server 2005/2008? I was thinking of storing that kind of information in a table (for which tables, which columns for which users access is restricted) and then manipulate it on the application site but my programmers tell me that they use components which always call the full table (like SELECT *).  Thank you for your answer.

How to perform math on a column of data in SQL database and display it in my VB app

Sorry if this is the wrong forum, cos it's SQL and VB2010 So I have my sqlserver database 3.5 compact editon called "Dive Club Records" and in it are stored columns of dive trip information and I want tthe user to be able run a query from my VB2010 application to sum a divers total dive hours and display it on the form, eg: MemberID, FirstName, LastName, DiveTime by the way divetime is a real number recorded as 15.5, 20.5, 5.0 etc What is the easiest way to do this? Would prefere to do it from within VB2010 code if possible or make a query from the datagrid on my form using query designer. thanks for any suggestions from you all, hope you can keep them simple for me :)   regards   paul   paul

C# newbie stuck - trying to access column data in a SharePoint list in an SSIS script task

Hello, I'm sure this is the simplest question but I can't figure it out, even with Google's help. I am trying to stumble through some C# code in an SSIS script task and I am frustrated that I can't figure out how to do the easiest things.  I eventually want to find data in a column,and then use another list as a lookup to replace that value with another where the existing value matches a value in the lookup list.  So, the data in my (multiple choice) column might be "apples; bananas" and in another list I have a row that contains two columns, the first holding the value "Apples" and the second containing "Red Delicious" and my original column should read: "Red Delicious; bananas." But, alas, I can't even figure out how to see the data that is in a column. Here is my code: /*<br/> Microsoft SQL Server Integration Services Script Task<br/> Write scripts using Microsoft Visual C# 2008.<br/> The ScriptMain is the entry point class of the script.<br/> */<br/> <br/> using System;<br/> using System.Data;<br/> using Microsoft.SharePoint;<br/> using Microsoft.SqlServer.Dts.Runtime;<br/> using System.Windows.Forms;<br/> using Microsoft.SharePoint.Utilities;<br/> <br/> namespace ST_08becda4c05c49cd9f30ea76110076cd.csproj<br/> {<br/> [

wpf charting column series data binding problem

I'm trying to build a chart using the columnSeries from the wpf toolkit and I appear to be having trouble with the data binding. Here is the xaml: <Grid>    <chartingToolkit:ColumnSeries Height="18" HorizontalAlignment="Left" Margin="188,169,0,0" Name="columnSeries1" VerticalAlignment="Top" Width="18" IndependentValueBinding="{Binding Path=Date}" DependentValueBinding="{Binding Path=Value}" /></Grid> In the code behind, I'm calling a stored procedure and putting the result in a datatable like this: string connString = ConfigurationManager.ConnectionStrings["string"].ConnectionString;            using (SqlConnection cn = new SqlConnection(connString))            {                DataTable dt = new DataTable("T1");                cn.Open();                SqlCommand cmd = new SqlCommand("T1_sp", cn);                cmd.CommandType = CommandType.StoredProcedure;                  SqlDataAdapter da = new SqlDataAdapter(cmd);                da.Fill(dt);                columnSeries1.ItemsSource = dt.DefaultView;                cn.Close();            } No error is being generated but I'm not getting a column chart either. If I take the same command and put it into a datagrid, it works fine. What do I need to do to get this into my column chart? If it helps,

XML Column containing single quote causes replication error

We have SQL Server 2005 transactional replication set up, and some of our tables have XML datatype columns.  We have run into an issue with the following error in the publication: Incorrect syntax near 's'. (Source: MSSQLServer, Error number: 102) Get help: http://help/102 Looking at the distribution database, I was able to extract the offending command, and it turns out that the XML column has a single quote (') embedded in it, and the command that was generated for inserting the row into the subscriber table has bad syntax because of the single quote (i.e., it is not escaped).  One interesting note is that the single quote happens to also show up in a non-XML column, and the command segment for that column was generated correctly (it was escaped). Is there a workaround / solution for this?

ssis sql 2000 image to 2008 varbinary Failed to retrieve long data for column

Hi, I have a task that to migrate the image type column from sql 2000 to varbinary type in sql 2008. The source column having 3812353 max datalength size for the column. The package always failed with following error message. [OLE DB Source [13177]] Error: Failed to retrieve long data for column "attch_file_content_t". [OLE DB Source [13177]] Error: There was an error with output column "attch_file_content_t" (13209) on output "OLE DB Source Output" (13187). The column status returned was: "DBSTATUS_UNAVAILABLE". [OLE DB Source [13177]] Error: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "output column "attch_file_content_t" (13209)" failed because error code 0xC0209071 occurred, and the error row disposition on "output column "attch_file_content_t" (13209)" specifies failure on error. An error occurred on the specified object of the specified component. There may be error messages posted before this with more information about the failure. Meng Chew

Set up a validator that compare the value of the current field with an other (using Dynamic Data)

Hi! Most of it is in the title : I'd like have a validator on the DateTime_Edit template for example that allows to compare this field with an other DateTime field. My problem is when I am in the DateTime_Edit template of my "master field" (the one I want to check), how can I access to the other field given the architecture of Dynamic Data FieldTemplates? But perhaps I'm not thinking in a good way on this control. Any advice will be welcome. Thanks Raphaelp

Problem while retrieving data from a lookup column from sharepoint linq.

Hi I am working with sharepoint linq concept. When I am giving a query with lookup column It's working fine.  But when i am trying to retrieve the data from a look up column to spgridview. I was unable to get the output. Here is the above code which i have worked.   string strTitle = string.Empty; string strStatus=string.Empty; var context = new LinqSampleDataContext(SPContext.Current.Web.Url); EntityList<SharePoint2010ConceptsItem> Concept = context.GetList<SharePoint2010ConceptsItem>("SharePoint 2010 Concepts"); var query = from cs in Concept where cs.Status.Title.ToString()!="Completed" select new { cs.Title, cs.Id, //cs.Status }; sgvConcepts.DataSource =query; sgvConcepts.DataBind();   Any help me plz how to retrieve the data from a lockup column.bvnprasad
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