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


Post New Web Links

When adding a colleague, can I add a reciprocal relationship back?

Posted By:      Posted Date: September 14, 2010    Points: 0   Category :SharePoint
 
Hi there,   I'm after functionality 'like facebook' (that must be a common phrase) I.e. when User A adds User B as a colleague, A is B's friend and most importantly B is A's friend   When I make a custom web part to show A and B their friends, they should both be on it.   The problem is if A requests B's friendship, B accepts and I forge a colleague link between B and A - that's fine, B can see A as a colleague   But, how can I tell from A that B is a colleague? ColleagueManager.IsColleague() returns true e.g. A.Colleagues.IsColleague(B) == true but B is not in A's Colleagues list (assuming two people only, A.Colleagues.GetItems().Length == 0)   The solution i've come up with is once B has accepted the 'friend request' in my own custom acceptance system, I create a UserProfile object for A and attempt to forge the link back (code below) - this however causes an UnauthorizedAccessException on the penultimate line - what am i doing wrong? Have i missed some vital part of the colleagues system? All help appreciated!   if (not already colleagues):   SPSecurity.RunWithElevatedPrivileges(delegate()                 {                     // Add the colleague relationship &


View Complete Post


More Related Resource Links

When adding a colleague, can I add a reciprocal relationship back?

  

Hi there,

 

I'm after functionality 'like facebook' (that must be a common phrase)

I.e. when User A adds User B as a colleague, A is B's friend and most importantly B is A's friend

 

When I make a custom web part to show A and B their friends, they should both be on it.

 

The problem is if A requests B's friendship, B accepts and I forge a colleague link between B and A - that's fine, B can see A as a colleague

 

But, how can I tell from A that B is a colleague? ColleagueManager.IsColleague() returns true e.g. A.Colleagues.IsColleague(B) == true but B is not in A's Colleagues list (assuming two people only, A.Colleagues.GetItems().Length == 0)

 

The solution i've come up with is once B has accepted the 'friend request' in my own custom acceptance system, I create a UserProfile object for A and attempt to forge the link back (code below) - this however causes an UnauthorizedAccessException on the penultimate line - what am i doing wrong? Have i missed some vital part of the colleagues system?

All help appreciated!

 

if (not already colleagues):

 

SPSecurity.RunWithElevatedPrivileges(delegate()
                {
    &

Adding back deleted User Profile Property

  

I've made a bit of an error. My SharePoint User Synchroniztion was all setup and working with My Sites and My Profile but the address was being duplicated. I removed one of the user profile properties under the contact collection. Now SharePoint can't render the My Profile pages. With logging turned up I get the following:

Unhandled exception caught during execution of Microsoft.SharePoint.Portal.PageBase::ErrorHandler()

Watson bucket parameters: SharePoint Server 2010, ULSException14, 06d8f9f3 "sharepoint portal server", 0e00129b "14.0.4763.0", b2be5063 "microsoft.office.server.userprofiles", 0e001294 "14.0.4756.0", 4b9b2905 "sat mar 13 05:56:21 2010", 0000082d "0000082d", 00000049 "00000049", 10bc7a81 "propertynotdefinedexception", 37706d61 "7pma"

Microsoft.Office.Server.UserProfiles.PropertyNotDefinedException: Property Not Defined: SPS-Location.  An administrator must create this property in the Profile Administration tool.    at

Problem is if I try to recreate a User Property with the name SPS-Location it won't let me so how do I get this back?

Paul

 


Adding a relationship causes an 'unspecified error' during SQL XML Bulk Upload

  

 

Hello, I am new to this bulk insertion and I've got a relationship problem that I cannot seem to solve and I have not found any answers that seem to match my predicament. Any pointers would be extremely welcome.

Basically, the relationship that sets up the customer tables works OK but when I try and add the relationship that should insert a row into the accountstatus table it all goes wrong with an unspecified error message. There's something wrong with the AccountAS relationship and how I've specified it in the element but I cannot figure out what it is.

Many thanks in advance for any help

Source XML

Code Block

<Accounts>

<Account>

<

An Entity Relationship Diagram Example

  
An Entity Relationship Diagram conveys a lot of information with a very concise notation. The important part to keep in mind is to limit what you're reading using the following technique:


Choose two entities (e.g. Company and Employee)
Pick one that you're interested in (e.g. how a single Company relates to employees)
Read the notation on the second entity (e.g. the crow's feet with the O above it next to the Employee entity).

Adding Dynamic Rows in ASP.NET GridView Control with TextBoxes and with Delete functionality

  
In my previous examples, I have demonstrated on how to add dynamic rows in GridView control with TextBoxes and how to save the values into the database. Now, seems that most of the developers are asking if how to add a delete functionality with it. So in this example, I'm going to show on how to delete a certain row in the dynamic GridView with TextBoxes.

Adding Rows in GridView without using a Database

  
This article describes on how to add rows in GridView without using a database. Basically the GridView will be populated with data based on the values entered in the TextBox on Button Click and retain the GridView data on post back.

Adding Multiple Columns and Rows in GridView without using a Database

  
This article describes on how to add multiple columns and rows in GridView without using a database. Basically the GridView will be populated with data based on the values entered in each TextBoxes on Button Click and retain the GridView data on post back.

Adding Dynamic Rows in GridView with TextBoxes

  
I decided to write this article because this has been asked so many times before at the forums(http://forums.asp.net) . Basically, this example shows on how to generate a Row in GridView with TextBoxes when clicking a Button that is residing inside a GridView Footer.

Adding Dynamic Rows in GridView with TextBoxex in C#

  
I decided to write this article because this has been asked so many times before at the forums(http://forums.asp.net) . Basically, this example shows on how to generate a Row in GridView with TextBoxes when clicking a Button that is residing inside a GridView Footer.

Creating an Excel Spreadsheet and Adding Data to It Programmatically

  
The Interoperability services make it veryeasy to work with COM Capable Applications such as Word and Excel. Thisarticle reveals using Excel from a managed application. Excel is thespreadsheet component of Microsoft Office 2000. The majority of Excelprogrammatic functionality is exposed through Automation via the typelibrary Excel9.olb. The intention of this article is to express that amanaged application can interrelate with Excel as a COM server.

Adding Search Refinements in SharePoint 2010

  
I have been playing around with SharePoint 2010 Search this morning. I love the new UI. The search refinements panel is just begging to be messed with. In my case I wanted to add the file extension JPG as an Image Type refiner.

Adding Client-Side Confirmation When Deleting

  
The JavaScript confirm(string) function displays its string input parameter as the text inside a modal dialog box that comes equipped with two buttons - OK and Cancel (see Figure 1). The confirm(string) function returns a Boolean value depending on what button is clicked (true, if the user clicks OK, and false if they click Cancel).

Enterprize library 4.1 getting output parameter after adding record in db, plz guide

  

Hi,

I need to get output parameter (flag) from db after saving record in database. I am using Microsoft Enterprise Library 4.1 for DB. I am inserting record using I Data reader.

Please guide

Thanks


dynamically adding sql server columns based on number of files in fileuploader

  

I want to create a new table to sql database at runtime.  The column names would be "Name", "Date", "Event".  I would also like to have one more column name "Image" but the problem is that since the amount of images will vary, I want the application to count the amount of files in the Multiple fileuploader and then add a image column to the table for the respected amount of files. 

For example if i am uploading 3 files in the multiple fileuploader, the names should be "Name", "Date", "Event", "Image1", "image2", Image3"

I also would like that table name to be name dynamically from the textbox Name when the user enters the information.

 

I have the following code to make a new table, but I dont know how to name the fields at runtime like previously asked please help!!!

 

Dim objConn As New SqlConnection("Server=<servername>;uid=<userid>;pwd=<password>;database=master")

objConn.Open()

Adding the table row below a particular row.

  

What is the best method in jQuery to add an additional row to a table as the row below a particular row?


Post back puzzle

  

Hi, I have a website where the user makes a selection from a combo box and it then fills a couple text boxes with text based upon the selection. I'm sure as you know it could take a second for the text to appear in the text box due to the post back. I know there is no way to make it instantanious, so what I would like to do it fill the text box with somthing like "Loading Info..." so the user does not type in it while the information is loading.

If you would like to see what I mean please go to this page: www.epiclinks.com/create.aspx and mess around with the combo boxes and You'll see what I mean.

What I would like to do is have it do a post back to write "Loading Info..." and then do another post back to fill it in based upon their selection. How would I do this?

I'm up for anything, so if you have a better solution than that please let me know.

Thanks.


Adding new items to a Repeater control with transitions?

  

Hi,

I am currently in the process of writing a facebook type 'activity feed' for a site. Currently I am binding the last 10 items to a repeater control, which contains a usercontrol representing each item. This works fine but there are a couple of requiremnts that are giving me problems and wondered if the the good people of the forum could make some suggestions.

The requirement is that when a user clicks a refresh button any new events are added to the top of the list, the previous items drop down and the equivalent number of old items drop off the bottom, all with nice slider transitions.

I have put the repeater inside of an update control and are able to handle the transitions by using RegisterStartup script to drop jquery calls onto the page for the slider. However I cannot find a way to dynamically add or remove new datarows to the repeater. I need the old items to stay in the repeater and be pushed down by the new items, so completely refreshing the datasource seems like a bad idea.

I was thinking about maybe storing the datasource in the viewstate and adding rows to that, maybe with an extra column on the end which stores what transition is needed on the databind for my jquery, but there will be a 'View more items' link at the bottom of the page, so I am worried that the list could get pretty large and there

Categories: 
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