SharePoint 2007 Get Field Type by Programmatically

You can get field type with display name.

Cool

 private string GetFieldTypeForCaml(SPList list, string displayName)
        {
            string sFieldType = string.Empty;
            for (int i = 0; i < list.Fields.Count; i++)
            {
                if (list.Fields[i].Title.Trim() == displayName.Trim())
                {
                    sFieldType = list.Fields[i].Type.ToString();
                    break;
                }
            }
            return sFieldType;
          }

Enjoy~! DDIBA Cool

Comments (3) -

Roulette System
Roulette System
5/10/2011 3:21:14 AM #

I do enjoy the way you have presented this situation and it does indeed give us a lot of fodder for thought. On the other hand, coming from everything that I have experienced, I just simply hope as the feedback pack on that people remain on issue and in no way start on a tirade involving the news du jour. Yet, thank you for this fantastic piece and whilst I do not really go along with it in totality, I regard the point of view.

Brody Snider
Brody Snider
5/11/2011 9:36:57 AM #

hello blogger, i was reading your posts on youngmoony | SharePoint 2007 Get Field Type by Programmatically and i actually liked them. one issue that i observed while browsing throughout your blog that some of the links aren't working and return error error. this makes the reading experience a bit bad. you have a good blog and i would request you to update the links so that fascinated folks can get all the info they intend to have. Btw are you on twitter?? i would definitely like to follow you and also get revisions in your blog.

Odzyskiwanie Danych
Odzyskiwanie Danych
5/12/2011 10:00:14 AM #

I'll be back here

Add comment




  Country flag
biuquote
  • Comment
  • Preview
Loading



Donate Me!

Please Help Us to Maintain This Site!

About the Author