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

Post New Web Links

SPMetal looping

Posted By:      Posted Date: September 29, 2010    Points: 0   Category :SharePoint

Hi all,

These days I'm deploying a sharepoint solution with code generated by SPMetal to linq sharepoint lists, but now, spmetal is in loop throwing these messages

Backin-up previous version of generated code...

Generating code...

Here is the picture http://twitpic.com/2t4gad

anyone can help-me ?


View Complete Post

More Related Resource Links

Looping through DataSet in C#


I have the following line of C# code that successfully returns the results of a stored procudure via a DAL:

spParamGetGamesTableAdapter spGG10 = new spParamGetGamesTableAdapter();

I can bind spGG10 to a DataGrid and see the stored procedure query results, so I know everything is good so far.

I want to loop through the spGG10 (DataSet table?) and output each row on a row-by-row basis using a Literal Control. I think I know how do the output part, so...

My question is: How do I access the data in spGG10 and loop through its records? (Also, I am not exactly sure what kind of object spGG10 really is. Is it a table?)

Thanks in advance.

Looping through controls to find reorderlist to set allowreorder


How would I loop through controls on a content page to set allowreorder of all reorderlists to false. Thank you. 

LinQ Syntax of looping a collection


Hi, I would be glad is there is anyone can point/teach me the correct way of iterate a collection in LINQ. I attached part of my coding for reference. I wish to find out the location(s) of an Employee who can also happen to be a Supervisor. My model contains a Many-to-Many relationship between Location and Employee. Thanks in advance


Dim someDataSource = From _e As Employee In _context.Employees
                                  Where _e.Locations = location <---- _e.Locations return a collection 
                                  Select _e.FullName, _e.ID


Looping through Excel 2007 tables in SSIS?

Saw the (http://msdn.microsoft.com/en-us/library/ms345182(v=SQL.90).aspx) msdn article on MSDN, however I need to loop through Excel 2007 tables, which is not supported via the .Net Connection.  Is there a way to loop through the 2007 sheets without resorting to a script component?Steve Walker

SharePoint 2010 AD FS 2.0 Integration - login works then fails, looping back to the adfs server

Hello, I setup SharePoint 2010 Claims auth with AD FS 2.0 following this post: http://blogs.technet.com/b/speschka/archive/2010/07/30/configuring-sharepoint-2010-and-adfs-v2-end-to-end.aspx.  I have no access to the ADFS server, but I think they followed the steps as outlined.  If I do an iisreset (or just recycle the app pool of the SharePoint site) I can login successfully using the remote credentials.  Also I can under security in SharePoint search for and find users and roles from the remote ADFS server. If I close my browser, open a new browser and go to the site I am prompted to login again (this is fine).  I do, using the same credentials, and the login fails because I am redirected between the SP and ADFS servers until the ADFS server stops the redirecting.  I have been doing some digging and I found this post: http://blogs.technet.com/b/speschka/archive/2010/08/09/setting-the-login-token-expiration-correctly-for-sharepoint-2010-saml-claims-users.aspx, which describes the situation I have in point # 3 at the bottom.  I have tried setting the token time out as low as 1 second but this hasn't helped. I have also, just to see, tried setting all the other lifetime settings to 1 second - but no luck.  Because the initial login works I think the setup is correct, but something is maintaining some state that is causing the loop

TraceListenerCollection is cleared when looping over IEnumerable

I have the following code in a class in a WPF application: In the constructor: foreach( var traceSource in AvailableSources.ToArray() ) traceSource.Listeners.Add( _listener ); Trace.AutoFlush = true; The AvailableSources property: /// <summary> /// Gets the available sources. /// </summary> /// <value>The available sources.</value> public IEnumerable<TraceSource> AvailableSources { get { yield return TraceSources.Network; // app-specific tracesource yield return TraceSources.Persistence; // app-specific tracesource yield return TraceSources.Gui; // app-specific tracesource PresentationTraceSources.Refresh(); yield return PresentationTraceSources.DataBindingSource;  // WPF tracesource yield return PresentationTraceSources.RoutedEventSource;  // WPF tracesource } } If I doesn't use ToArray() on the property AvailableSources in the foreach loop, the Listeners collection will have zero listeners. If I step through the foreach loop, I will at the end (but before hitting the first line of code outside the loop) have 1 listener in each TraceSource' Listeners collection. When I hit the first line after the loop, I get Listeners.Count = 0 on each tracesource. I've used the immediate window in VS.Net to get the current count of the listeners collection and also verified that the hash code of each tracesource instance

C# socket looping in response

Hi,   I'm getting data from a TCP server that sends bulk data in burst load. Can I use socket available property to loop in receiving data as below ? Or is it equivalent to peeking which is not recommended in winsock ? Thanks in advance and regards Navin --------------------------------------------------------- //to run loop m_bContinue = true;   int nReceivedBytes = 0;   int cntBytesRead = 0;   string m_strData = "";   StringBuilder sbData = new StringBuilder(); //Loop here while   (m_bContinue) { if   (!m_socket.Poll((Constants.SOCKET_POLL_TIMEOUT_MS % 1000) * 1000, SelectMode.SelectRead))   continue;     int cntAvailBytes = m_socket.Available;   if (cntAvailBytes > 0) {   arrBytesData = new byte[cntAvailBytes];   while (cntAvailBytes > 0) {   int nBytesToRead = cntAvailBytes; nReceivedBytes = m_socket.Receive(arrBytesData, nBytesToRead, SocketFlags.None);   if (nReceivedBytes > 0) {   //convert data from byte array to string   string data = System.Text.Encoding.UTF8.GetString(arrBytesData, 0, nReceivedBytes);   sbData.Append(data); cntAvailBytes -= nReceivedBytes;     }//while (cntAvailBytes >0 ) m_strData = sbData.ToString();

SPMetal and Item Attachments

i am currently able to generate the LINQ data class from SpMetal.exe, but i am having a problem how can i generate or modify the SpMetal code to show my Item's Attachments ?    

How do i create a looping script

How do I create a script where it will loop through a set of WHERE clause.

spmetal generated class and content type (for page layout) retrieve problem


I'm working with a console application to generate my sites and subsites (hierarchy). And i've got a problem with a generated spmetal class.


this doesn't work:


static void Main(string[] args)


            string SITE = string.Concat("http://"Environment.MachineName);         



Help on SPMetal


Hi All,


I have few Questions on SPMetal uses.

1) After I create Entity class on dev box, How should I use same for QA box? Do I need to regenerate Entity class.

2) Whenever there is changes in List's Columns, Do I need to regenerate Entity class, Whats happens when End user do some changes on List Columns?

3) What happens if change some columns type in Entity class?

Looping a Stored Procedure


Afternoon Team looking for some help regarding looping a stored procedure.  My Procedure updates two tables Parent and child and is working fine. 

Now in ASP on the click button event it runs and inserts data to both tables as I would like, what I want to do though is have a text box and if the user

say enters the number 3 the stored procedure will run 3 times automatically giving me the 3 entries to the database so to speak I know the data will be the same

but I want the 3 unique numbers it will generate.  (PK and FK set to identity) Is there an easy way to loop this process I have tried using a loop but it still only making

one entry into the database so it's not quite right.


Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click

        Dim Counter As Integer
            Counter = Counter + 1
        Loop Until Counter = Convert.ToInt32(TextBox1.Text) -- Number of times I want the procedure to run 

        Using connection As New SqlConnection(ConfigurationManager.ConnectionStrings("STOCKConnectionString1").ConnectionString)

            Dim command As New SqlCommand("dbo.Packtest", connection)
            command.CommandType = CommandType.StoredProcedure


Design window hangs in WPF, devenv.exe starts looping CPU around 50%


I attempt to create a new WPF project but the design window never populates and appears to hang.  CPU usage for devenv.exe starts looping around 50% usage.  I can close the project with no problems.  I disconnect the USB VGA adapter and the WPF project will load and save with no issues.  Re-connect the adapter and problem returns with any new or current project that was just working.  I've had this same problem on a different model laptop, Dell 630 I believe, as well with a physically different adapter but same model.

I've been experiencing this problem for about a year and have since gone to a different laptop and new adapter drivers and the issue persists after a fresh install of the O/S, VS2008 with SP1. Any recommendations besides not using the adapter, it's pretty integral to other job duties that I have to perform and the issue precludes me from being able to develop in the WPF environment.

Currently using a laptop DELL Latitude E6400 4 Gig memory with 2 external monitors in which one connects to the VGA port and the other connects to a USB VGA adapter (Tritton SEE2 UV100) and have installed their latest drivers.

O/S :  Windows Vista Enterprise SP2 (32-bit) 

Visual Studio 2008 SP1 

Microsoft Visual Studio 2008
Version 9.0.30729.1 SP
Microsoft .NET Framework
Version 3.5 SP1

Installed Edition: Standard<

SPMetal Error: An item with the same key has already been added.


I created a Visual Web Part project in VS 2008. Try to create the proxy code for a site using SPmetal. I got this error:

Error: An item with the same key has already been added.

Any idea?



ReportViewer looping ajax calls to keep session alive causes Firefox to look like it's constantly r

In the HTML generated by the ReportViewer there is the following line of code (I've tried ot make it more readable by removing the superfluous information)
setTimeout("frames['ReportViewer1TouchSession0'].location.replace('/Reserved.ReportViewerWebControl.axd?...&TimerMethod=KeepAliveMethodReportViewer1TouchSession0...", 0);

function KeepAliveMethodReportViewer1TouchSession0() {
   setTimeout("frames['ReportViewer1TouchSession0'].location.replace('/Reserved.ReportViewerWebControl.axd?...TimerMethod=KeepAliveMethodReportViewer1TouchSession0....", -1703027296);


When the Reserved.ReportViewerWebControl.axd is called it makes a GET request that returns the following HTML:


<html><body><script type="text/javascript">parent.KeepAliveMethodReportViewer1TouchSession0();</script

 So in effect it becomes a recursive function and because KeepAliveMethodReportViewer1TouchSession0 calls a set timeout with a negative timeout value, in Firefox it's called immediately, in about 10 secon

Inserting/updating DB looping Excel data of huge number of records




    I have requirement to read the excel data and based on some conditions ih ave either insert/ update the data in to Oracle tables. to check the condition I have to loop through the 4 columns for 4 conditions which may consist of huge number of records, where performance issue arise here. please put me in the right way or suggest me a best approach to break through the performance issue as well.

ofcourse i am writing in a service.

Looping Label Controls


How can I loop through all my asp:lables inside my asp:tables?  I need to check every label on my page and see if the text inserted from our database says a specific word.  If the word is what we are looking for, I change the forecolor of the word in the asp:label to Red.

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