.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

adding XML 'records' with a key field

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net

I have a vb.net Sub that is successfully adding 'records' to my XML file:

Private Sub btnSubmit_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles btnSubmit.Click             'for adding an XML 'record'
        Using ds As New DataSet()
            Dim dr As DataRow = ds.Tables(0).NewRow()
            dr("subject") = txtNewEvent.Text
            dr("year") = DateTime.Now.ToString("MM/dd/yy")
            txtNewEvent.Text = ""

View Complete Post

More Related Resource Links

Workflow field not being added to list or views when adding a workflow


This problem just started happening in my entire site collection.  Anytime I associate a workflow to any list or doc lib the Workflow column that shows the status and links to the history is not beind added to the list or any views and is nowhere to be found.   Here's exactly what I'm doing:

1.  Go the List settings -> workflow settings -> add a workflow (for this example the OOB approval workflow)

2.  After adding I go to the List, the workflow column doesn't exist.

3.  I go to "modify view", and the workflow column is not listed in the available columns.

Any help is greatly appreciated.

Adding starting text to a column field

I am wanting to know if there is a way you can add starting text within a field that displays within a page layout?  I have a page layout that has a field (column) called 'page summary'. What I want to do is when a content managers creates a new page based on that page layout, the text "This page contains a public notice" is automatically inserted in the page summary field and the content manager can continue typing or highlight the text and remove it. Kind of like adding a base 'Text Value' to the field (column).  I want to be able to do it without having to do custom code though.

Splitting a memo field into lines and adding a value at the start of each line

I have one memo field which has a bunch of text in it. I want to update another memo field from the first one but i want to divide it into lines of 50 characters and put a carriage return at the end of each line and a string value (Note:) at the beginning of each line But I am not sure how to go about it. The text in the first field may have line breaks and carriage returns or it may not. So is there a way i can strip out anything like that first See example below Memo Field1 The quick brown fox jumped over the lazy dog. And the Dish ran away with the spoon, the little dog laughed to see such fun and the Cow fell of the wall Memo Field2 Note: The quick brown fox jumped over the lazy dog. And Note: the Dish ran away with the spoon, the little dog l Note: aughed to see such fun and the Cow fell of the wal Note: l   ideally it wouldn't cut words in half but I think I may be asking too much.   Is this possible?

Issue Adding a new Lookup Field to an existing List Instance

I have a code base that houses all of the column, content types, template, and list instance definitions. Am using the Update functionlaity a lot from version to version. Has been working well to this point. I just added two new columns (fields), one a Lookup and the other a Multi-Lookup. The fields are added fine on the update, columns look correct and the content type to which these were added also look fine. I can create a new List instance from the content type, and the new lookup columns are fine. The problem is this. Any existing list instances that were created from this same content type, now blow up when I try and access list items via the SP GUI. Something about a valid GUID, I dont't have the exect error anymore, but will repost it when I recreate the issue for the tenth time. I tried deleting the new lookup fields from this new list instance, thinking that I might be able to re-add them to fix the problem, but I get a new stack trace when I try and re-add them. Any hints on where I can start digging would be appreciated. I think I'll start with comparing the list instance schemas between an existing list and a newly created one.  

adding sharepoint attachment field to customlist


I added the  sharepoint attachment field.

 <SharePoint:AttachmentsField runat="server" ID="sp1" ControlMode="New" FieldName="Attachments"></SharePoint:AttachmentsField>       

But i could not see the control either on my pages.

I tried to put some validation on my customlist using ASP.NET requiredFieldValidatoon.

While changing the the Format as TextBox on Sharepoint Formfield,its turn to be nothing instead of showing the generic text box.

Also my Sharepoint field name id i used to get like "ff2{Pos}" on my SPDesigner 2007.I can't attach this id to ASP.NET required field validator.

Any idea ?




Think More..Do More..

When adding new calendar item the title field is missing - MOSS 2007



A staff member just noticed that when adding a new item to a vacation calendar we have set-up - the Title column is missing.  They will finish creating the new calendar item and then when they go to edit it the Title column appears and they can fill it in.

Can figure out what caused this or how to fix - any ideas?

When I create a new test calendar the title column is displayed properly when creating new item - so not sure what happened with this calendar.

Hope someone has come across this before.

Thanks so much!

How to avoid adding MY prefix to field name in InfoPath ?



I have created a new form from xml format. So, I want to add several fields. But, when I try to add a new one, InfoPath adds prefix my:  to my fields name. Is it possible to disable adding this prefix?

Now it is   /Data/Financial/Schedule/Advance/Row/my:Sum

But I need this  /Data/Financial/Schedule/Advance/Row/Sum , because other fields without "my:" prefix.

retrive details records as a field in master table


I have 2 tables:

Student table with Id, Name fields

Phone table with Id,StudentId,PhoneNumber

Now, I want to show student list with all it's phone numbers in 1 row.

this query: "select student.*, phone.* from student inner join phone on student.id=phone.studentid" shows me the list of students with duplicate per each phone number.

I want something like this:

1 paul       66665566,7766665

2 ben        5566556,8877667

3 sam       4444334,3454332,7656765

Designing lists: Quick key combination for adding a new list column field?


I'm simply looking for a way to quickly design lists, and I find it rather slow to use the mouse to go to the Add New Column button in the ribbon every time when I want to add a new list field.

The only column that can't be changed type of later seems to be the Calculated column. But for all others, you can still change them afterwards.

Adding Linq records C#


I haven't quite grasped this in LINQ. I have a two tables called Products and Orders. Products contains a field called orderid. I want to create a new record in Orders and populate orderid with the PK from the new record in Orders. A one to one relationship.


Order neworder = new Order();

creates a new record in Orders.  How do I then tell the Products table what the PK is. If I try something like

Order neworder = new Order();
q.orderid = neworder.OrderID;

It doesn't work.


Adding a calculated field to a databound control


I'm using a gridview to extract a set of records. I need to add another field to the gridview, which can calculate the difference between a date associated with each record and the current date. Ideas?

Getting error while adding field to data viewer web part


I have custom EditItemForm for a custom list having over 100 columns. That EditItemForm contains a DataFormWebPart in edit mode having over 100 <SharePoint:FormField controls.


If I browse for the above page in internet explorer, I got got the generic error:


"Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Microsoft SharePoint Foundation-compatible HTML editor such as Microsoft SharePoint Designer. If the problem persists, contact your Web server administrator.

Adding a new field to a table via script in sql server management studio

I know how you can script to and create a new table but how about adding a new field to this table? For example: how would i add a new varchar(50) field named mynewfield?

USE [example]
/****** Object: Table [dbo].[Password]  Script Date: 10/26/2010 10:17:30 ******/
CREATE TABLE [dbo].[Password](
	[user_id] [int] NOT NULL,
	[password] [varchar](30) COLLATE SQL_Latin1_General_CP850_BIN2 NULL,
	[response1] [varchar](40) COLLATE SQL_Latin1_General_CP850_BIN2 NULL,
	[response2] [varchar](40) COLLATE SQL_Latin1_General_CP850_BIN2 NULL,
	[response3] [varchar](40) COLLATE SQL_Latin1_General_CP850_BIN2 NULL,
	[user_id] ASC

ALTER TABLE [dbo].[Password] WITH CHECK ADD CONSTRAINT [User_Password_FK1] FOREIGN KEY([user_id])
REFERENCES [dbo].[User] ([id])
ALTER TABLE [dbo].[Password] CHECK CONSTRAINT [User_Password_FK1]

Adding HTML Publishing Field to Content Type via the API


I have a site feature receiver that sets up all my custom columns and content types. This appears to have a persistent issue with adding field references to publishing controls, in example below it is an HTML Publishing Field but this also happens on a Publishing Image Field. In summary: - Publishing HTML Field creates successfully and is added to the Site Columns (see method CreateHtmlField below) - Content Type creates successfully and updates ok with an SPFieldLink to my custom field of type SPFieldText (non publishing) - When trying to add a SPFieldLink to an HtmlField, however I get an ArgumentNullException

Detailed exception from 14/LOGS: System.ArgumentNullException: Key cannot be null. Parameter name: key at System.Collections.Hashtable.get_Item(Object key) at Microsoft.SharePoint.SPFieldLinkCollection.Exists(String name, SPFieldLink& fldFound)

Tracing this down the hierarchy of calls into SP SPFieldCollection.Add() calls SPFieldCollection.Exists() with the SPFieldLink.Name property, however this is a read only value which is derived from SPField.InternalName

SPField.InternalName is set in 2 of the 3 constructors of SPField, however, I'm using the 3rd one with signature: public SPField(SPFieldCollection fields, string typeName, string displayName)

SPField doens't seem to set that anywhere else and neighter does the HtmlControl.

Error when adding a record routing to the record routing list in the Records Center




When I try to add a record routing I get this error:

  • "The Records Center Web Service Submitters group could not be added to the location you specified. You might not have the necessary permission to perform this operation."

Does anyone know why?

Does anyone know what to change?

I am a site collection admin. I am a local admin on the server. I am a site admin for RC. The application pool identity accounts have been added to the Records Center Web Service group!









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.
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