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


Post New Web Links

How to navigate through a list stored in session

Posted By:      Posted Date: August 31, 2010    Points: 0   Category :ASP.Net
 
Hi I have a problem where I would have a dataset that I would break into 5 new generic LIST<>. Now the user needs to see one record at a time and navigate through the list Fields like               From date : Text box with calendar                To Date : Text box with calendar               Manager Reporting To : Drop down list                Buttons on Move Back  and move Forward Now I would have 4 such similar lists which I have to pick up from the audit table. When the user clicks on move back and move forward buttons he should be able to navigate through records in my list that I have fetched in the beginning . I can store it in a session or viewstate till it gets updated again. How do I achieve this. Should I be writing  a webmethod to go back and pick up the next record agian and display Can I also a gridview instead of textboxes. What should be the simplest way to achieve this. Thanks!      


View Complete Post


More Related Resource Links

Populating a list box in InfoPath from a sql stored proc

  

I have an InfoPath web enabled form that gets published to a SharePoint site.  I need to add a list box to the form that gets populated with data returned from an existing call to a SQL Stored Proc.  

As the form works now, the user types in a patient id #, then clicks a button that calls the Stored Proc and returns any patients that match the given patient ID.  This part works.  

My task is to add a list box so that if more than one patient is returned , display the list box with all of these patients populated in it.

I am hoping to do this within the confines of the existing code.  The existing code looks like this:

private bool LoadPatientInformationFromDB(string patientId, string patientFirstName,
      string patientLastName, string patientMiddleInitial, string birthDate, string gender,
        string admitDate, string location)
    {
      bool completed = false;
      //Load from DB
      SqlConnection conn = new SqlConnection(GetOrderSetDBConnectionString()); 
      //Create Form Builder
      formBuilder = new FormBuilder();
      SqlDataAdapter adpt = null;
      
      try
      {
        if (!String.IsNullOrEmpty(patientId) || !String.IsNullOrEmpty(patientFirstName) ||
          !String.IsNullOrEmpty(patientLastName) || !String.IsNullOrEmpty(patientMiddleInitial)
          || !St

SharePoint List with Hyperlinks Stored in a Database

  

To all,

I need to display a List of Hyperlinks that are stored in a database. I want it to be a SharePoint List so it can be Indexed and Search properly in SharePoint.

SharePointSite Table - Columns:SiteName(nvarchar(256)), URL(nvarchar(256))

Example: Acme Foods, http://www.acme.com

I need a List that shows:

Acme Foods and is a clickable hyperlink  to http://www.acme.com

What is the best way to get access to the data and feed it to a List and then host it on a Site landing page?

This is meant to be a directory of Site Collections. We have 175 Site Collections that host our customers Report Libraries.

Thanks,
Eric

 


TSQL: Passing array/list/set to stored procedure (MS SQL Server)

  
Passing array/list/set to stored procedure is fairly common task when you are working with Databases. You can meet this when you want to filter some collection. Other case - it can be an import into database from extern sources. I will consider few solutions: creation of sql-query at server code, put set of parameters to sql stored procedure's parameter with next variants: parameters separated by comma, bulk insert, and at last table-valued parameters (it is most interesting approach, which we can use from MS SQL Server 2008). Ok, let's suppose that we have list of items and we need to filter this items by categories ("TV", "TV game device", "DVD-player") and by firms ("Firm 1", "Firm2", "Firm 3). It will look at database like this So we need a query which will return us list of items from database. Also we need opportunity to filter these items by categories or by firms. We will filter them by identifiers. Ok, we know the mission. How we will solve it? Most easy way, used by junior developers - it is creating SQL-instruction with C# code, it can be like this List<int> categories = new List<int>() { 1, 2, 3 };   StringBuilder sbSql = new StringBuilder(); sbSql.Append( @" select i.Name as ItemName, f.Name as FirmName, c.Name as CategoryName from Item i inner join Firm f on i.FirmId =

Navigate through a generic list using a webservice

  
Hi I have a problem where I would have a dataset coming to me and I would break into 5 new generic LIST<>. Now the user needs to see one record at a time and navigate through the list Fields like               From date : Text box with calendar                To Date : Text box with calendar               Manager Reporting To : Drop down list                Buttons on Move Back  and move Forward Now I would have 4 such similar lists which I have to pick up from the audit table. When the user clicks on move back and move forward buttons he should be able to navigate through records in my list that I have fetched in the beginning . I can store it in a session or viewstate till it gets updated again. How do I achieve this. Can I also a gridview instead of textboxes. What should be the simplest way to achieve this. Thanks!      

can a Workflow access a stored procedure and pass the parameters from the list data to the stored pr

  
The reason that I would like to consider this functionailty is because my table architecture is complicated and I do not want to modify my master table to accept all of this data where some of the data should be normalized into sub tables.  Has anyone see evidence of the stored-procedure parm approach?  Is this best accomplished through VS 2010 or can I do it through SPD? Thanks

MOSS 2007: list column that lookup to multiple documents stored in doc library

  
Hi All, I'm trying to understand how to customise MOSS to achieve the following: I need to lookup from a list to multiple documents stored in a documetn library. Example: - List item 1 --------> Lookup to Doc 2                   --------> Lookup to Doc 5 - List item 2 --------> Lookup to Doc 3                   --------> Lookup to Doc 5                   --------> Lookup to Doc 8 - List item 3 --------> Lookup to Doc 1 How can I achieve this? is it possible that in the lookup I have a "search" option? Thanks all Vit

Weird casting error (storing Generic list in Session)

  

Am trying to store a generic list in Session to act as a simple shopping cart. Am getting a weird casting error when I try and retrieve it from Session.

A critical error has occurred.
[A]System.Collections.Generic.List`1[MyCartItem] cannot be cast to [B]System.Collections.Generic.List`1[MyCartItem].
Type A originates from 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
    in the context 'LoadNeither' at location 'C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll'.
Type B originates from 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
    in the context 'LoadNeither' at location 'C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll'.


I have a class variable defined:

List<MyCartItem> _cart;

In the Load event I have:

_cart = (Session["MyCart"] != null) ? (List<MyCartItem>)Session["MyCart"] : new List<MyCartItem>();



Where Does a SharePoint List Data stored in SQL server ?

  

can you please specify where will the sharepoint list data will be saved in sql server?

 

please throw your thoughts?

 

Thanks in Advance!

 


Share Knowledge and Spread Love!

Keep updating Session object with a new List c#

  

I have a Session object


Session["MyListObjects"] = null;

When a user hits a button I want to creat a List<string> object and add to session object.

Let's say if user hits the button 10 times, I would get 10 List<string> objects and
add to Session["MyListObjects"] and

Finally I want to read all the List<string> objects from the session object.

Please let me know how to do that.
Thanks,


Pass list to stored procedure

  

Hi,

I'm looking to pass a list into a stored procedure, stored as List<myClass>.  I've passed a table in before but I'm not sure how to pass a list - anyone help?



ListData.svc REST API can't navigate relationship to lookup list in parent site

  

I have created a list in the root web that contains common information used by multiple sites throughout the site collection.  I have also created a site column that is a lookup column which pulls from that list.  This way, I can add the site column to any list in any sub site in the site collection. 

I have a list in a sub site in the same site collection that I have added the root web site column to and, from the UI perspective, everything works great.  I can add a list item to the sub site list and select an item from the root web list for that column. 

However, if I generate a strongly typed data context and associated classes using a Visual Studio service reference to ListData.svc (or if I just play around with the REST XML in the browser), the class property which represents the lookup column in the sub site list only contains the ID of the lookup item, not a reference to an instance of the item. 

I understand that the experience getting list information from a different site is usually less than optimal but are there any workarounds to get a reference to that lookup list item via the REST API?


Deleting items from a list based on a stored procedure

  
          foreach (SPListItem listItem in collListItems)
          {
            var result = db.sp_MOSSCloseCase(Convert.ToInt32(listItem["Case Number"]));
            if (result == listItem["Case Number"])
            {
              listItem.Delete();
            }
          }

 

Obviously I can't delete items in a collection within a Foreach loop. Problem is that the stored procedure is to return the case number in the DB only if there is a completed date(case being closed). So i thought if (result != null) then move the result to a List or something. Then go through the list and delete items where results = item["Case Number"] but result is never null... nor does it ever == listItem["Case Number"]

 

For the life of me, I cannot figure out how to get the result values into a list and then delete them from the SPList.


How can navigate the records using stored procedure in front end?

  

Hi all i have a task like i had windows form with studentid, sname, marks and buttons for first, next ,prev, last. Now i have to get the data form table student and display and navigate the records by using stored procedures only with put datareader or dataset..

Any body can me help me out?

thanks in advance..


Forms Values Stored in Session

  

I am using the following code to store some form values into Session and then retrieve them the next time the users uses the form to save them having to be re-entered.

            If Not (Session("workarea") Is Nothing) Then
                workarea.SelectedIndex = Session("workarea")
            End If

            If Not (Session("workplace") Is Nothing) Then
                workplace.SelectedIndex = Session("workplace")
            End If

            If Not (Session("postcode") Is Nothing) Then
                postcode.Text = Session("postcode").ToString()
            End If

            'insert form data into session variables for use again
            Session("workarea") = workarea.SelectedIndex
            Session("workplace") = workplace.SelectedIndex
            Session("postcode") = postcode.Text

But intermittently when re-visiting the form the values aren't being retrieved from session. Is there a reason and resolution for this? Could this be due to load balancing on the web server? Is there a resolution for this?


Stored procedure to get list of files and downloaded

  
Hi all,I have the below table which gets updated whenever the files get downloaded.The details of list of filenames downloaded will be saved in this table.i need to get the files which are downloaded and put it into a temp table on regular basis.From that Temp TAble i will use the Filenames and split each file into two.The DownloadID will be unique in this table.I need to write a Stored procedure for all this process.How will be the stored proc?i need to call this proc in a job.can you help me in writing the proc..
DownloadID	ConfigurationId		FileName	          LogDate	     FilePublishedDateTime	 
1	          2301		Nobel_2010_10_01.tsv	 2010-10-01	2010-10-04 02:19:53.000	
2	          2301		Nobel_2010_09_08.tsv	 2010-09-08	2010-09-09 21:49:00.000	
3	          2301		Nobel_2010_09_08.tsv	 2010-09-08	2010-09-09 21:49:00.000	
4	          2701		System_2010_10_01.tsv	 2010-10-01	2010-10-03 23:57:41.000 
5	          2401	     Boot_2010_10_01.tsv	 2010-10-01	2010-10-04 00:46:19.000 
Thanks in advance!!

session variable list collection

  


Hi all

Can anyone help me about list collection?

i want to pass multiple selected checkbox values to another page with session. 

here is my code..

First Page



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

            Dim productIDs As List(Of String) = New List(Of String)
            For Each item As GridDataItem In RadGrid1.SelectedItems

                Dim chkBox As String = item("ProductID").Text
                productIDs.Add(item("ProductID").Text + " ".ToString())
                ' Assuming that the first column in your grid is the productIDs column   

            Next

            Session("ProductIDs") = productIDs
            Response.Redirect("Cart.aspx")

                End Sub

Second Page...


    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Infopath dropdown list populated by files stored in svn

  

Hi, I'm familiar with populating a DDL in my InfoPath (using 2010) form from a List in sharepoint however I would also like to be able to do this against an existing svn repositry but do not know if this is possible?

The situation I have is that that a number of assets exist in a svn repo, I need to have the form auto-update & populate the DDL with the filenames there. Any ideas on how to do this would be much appreciated!


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