Click here to Skip to main content
15,917,610 members
Home / Discussions / C#
   

C#

 
GeneralRe: Speed MyDriver Day !!! Pin
morisson_c20-Mar-08 2:48
morisson_c20-Mar-08 2:48 
GeneralRe: Speed MyDriver Day !!! Pin
Bekjong20-Mar-08 3:53
Bekjong20-Mar-08 3:53 
GeneralRe: Speed MyDriver Day !!! Pin
morisson_c20-Mar-08 4:03
morisson_c20-Mar-08 4:03 
GeneralCached Values Pin
Chrispie12320-Mar-08 2:30
Chrispie12320-Mar-08 2:30 
QuestionAssign drive letter Pin
boschler20-Mar-08 1:22
boschler20-Mar-08 1:22 
GeneralRe: Assign drive letter Pin
Vasudevan Deepak Kumar20-Mar-08 5:44
Vasudevan Deepak Kumar20-Mar-08 5:44 
GeneralRe: Assign drive letter Pin
boschler26-Mar-08 2:54
boschler26-Mar-08 2:54 
Generalconverting string with multiple values to string array Pin
gottimukkala20-Mar-08 1:18
gottimukkala20-Mar-08 1:18 
Hi All,

I am writing a function that accepts a string with values seperated by commas. I want to loop through all these values in the string and send each value as a string to another method.

I am tring to do like this using arrays and loop through each value in the array: for this i am getting a error message

private string InsertPublication(string structureId, string language, string title, string parentId, string contextId, int sortOrder, string pubIds)
{
string _response = "";
string[] pubId = new string[];

if (pubIds.Contains(","))
{
for (int i = 0; i < pubIds.Length; i++)
{
int first_pId = pubIds.IndexOf(',');
pubId[i] = pubIds.Substring(0, first_pId);
}
}
else
{
pubId[0] = pubIds;
}
for (int i = 0; i < pubId.Length; i++)
{
if (parentId == "")
{
parentId = null;
}
string _elementId = _wdService.InsertPublication(structureId, language, title, parentId, contextId, sortOrder);
if (_elementId.IndexOf("Error") < 0)
{
if (pubId[i].ToString() != "")
{
try
{
string _response2 = _wdService.JoinLeafPublication(structureId, _elementId, pubId[i].ToString());
_response = _response2;
if (_response2.IndexOf("Success") == -1)
{
_response = "Failed";
}
}
catch
{
_response = "Failed";
}
}
else
{
_response = _elementId;
}
}
else
{
_response = _elementId;
}
}
return _response;
}

could any one please tell me.


Thanks
Aruna.G
GeneralRe: converting string with multiple values to string array Pin
Not Active20-Mar-08 1:23
mentorNot Active20-Mar-08 1:23 
GeneralRe: converting string with multiple values to string array Pin
Farhan Ali20-Mar-08 1:24
Farhan Ali20-Mar-08 1:24 
GeneralFileUpload1.Postedfile.FileName not working in firefox Pin
Farhan Ali20-Mar-08 1:10
Farhan Ali20-Mar-08 1:10 
GeneralNeed Information Pin
Krazy Programmer20-Mar-08 0:45
Krazy Programmer20-Mar-08 0:45 
AnswerRe: Need Information Pin
Abhijit Jana20-Mar-08 1:04
professionalAbhijit Jana20-Mar-08 1:04 
GeneralRe: Need Information Pin
Vasudevan Deepak Kumar20-Mar-08 5:45
Vasudevan Deepak Kumar20-Mar-08 5:45 
GeneralBitmap Clipping Pin
free_soul42420-Mar-08 0:35
free_soul42420-Mar-08 0:35 
GeneralMultiple header in a gridview Pin
SeeSharp20-Mar-08 0:28
SeeSharp20-Mar-08 0:28 
GeneralRe: Multiple header in a gridview Pin
morisson_c20-Mar-08 2:30
morisson_c20-Mar-08 2:30 
GeneralRe: Multiple header in a gridview Pin
SeeSharp20-Mar-08 22:14
SeeSharp20-Mar-08 22:14 
GeneralborderSize = SystemInformation.Border3DSize.Height; ISSUE Pin
Harvey Saayman20-Mar-08 0:19
Harvey Saayman20-Mar-08 0:19 
GeneralRe: borderSize = SystemInformation.Border3DSize.Height; ISSUE Pin
DaveyM6920-Mar-08 13:03
professionalDaveyM6920-Mar-08 13:03 
GeneralRe: borderSize = SystemInformation.Border3DSize.Height; ISSUE Pin
Harvey Saayman24-Mar-08 20:22
Harvey Saayman24-Mar-08 20:22 
GeneralQuery in voice chat Application Pin
Jayavel20-Mar-08 0:12
Jayavel20-Mar-08 0:12 
JokeRe: Query in voice chat Application Pin
Vasudevan Deepak Kumar20-Mar-08 5:47
Vasudevan Deepak Kumar20-Mar-08 5:47 
GeneralPrinting any file (*.txt,*.pdf,*.gif,*.doc etc)using c# Pin
hariomhari20-Mar-08 0:03
hariomhari20-Mar-08 0:03 
GeneralRe: Printing any file (*.txt,*.pdf,*.gif,*.doc etc)using c# Pin
geekfromindia20-Mar-08 5:19
geekfromindia20-Mar-08 5:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.