Click here to Skip to main content
15,902,447 members
Home / Discussions / C#
   

C#

 
AnswerRe: WebBrowser control reset Pin
Ayman Kouzayha2-Jul-10 1:19
Ayman Kouzayha2-Jul-10 1:19 
GeneralRe: WebBrowser control reset Pin
Etienne_1232-Jul-10 2:07
Etienne_1232-Jul-10 2:07 
GeneralRe: WebBrowser control reset Pin
Ayman Kouzayha2-Jul-10 7:28
Ayman Kouzayha2-Jul-10 7:28 
Questionhow to get the work done back when kept in keep queue.... Pin
Nivas821-Jul-10 23:35
Nivas821-Jul-10 23:35 
AnswerRe: how to get the work done back when kept in keep queue.... Pin
R. Giskard Reventlov1-Jul-10 23:56
R. Giskard Reventlov1-Jul-10 23:56 
QuestionHow to use Combo.SetEditSel in C# Pin
raju_shiva1-Jul-10 22:17
raju_shiva1-Jul-10 22:17 
AnswerRe: How to use Combo.SetEditSel in C# Pin
Richard MacCutchan2-Jul-10 0:23
mveRichard MacCutchan2-Jul-10 0:23 
QuestionPassing string to stored procedure. Pin
meeram3951-Jul-10 21:40
meeram3951-Jul-10 21:40 
I have a long string which I need to check its existence in database. The string is follows:

string str = AU000AC20095=YBAX ,XS0088980494=MLIL,IT0003953350=HVBT 

To make it sql compliant like.

Following is the sql query I need to execute:
SELECT ISIN_Universe_Id,ISIN,RIC,DateCreated from ISIN_Universe where ric in 
('AU000AC20095=YBAX','XS0088980494=MLIL','IT0003953350=HVBT')


So I declared a varchar variable and passing this string. In C# code, i am using the following function for this:

public string CreateRICList(RICObject[] ricobj)
		{
			StringBuilder sb = new StringBuilder();

			sb.Append("'");
			for (int i=0; i<=ricobj.Length - 1; i++)
			{
				sb.Append("''");
				sb.Append(ricobj[i].RIC);
				sb.Append("''");
				sb.Append(",");
			}
			string lstrics = sb.ToString();
			if (lstrics.EndsWith(","))
				lstrics.Replace(",","'");

			return lstrics;
		}

However, the string is not forming correctly. Is there any issue with the above code? Or is there any other method which I can pass the whole string at a stretch? Please help.

This is my stored procedure:

EXEC ('SELECT ISIN_Universe_Id,ISIN,RIC,DateCreated from ISIN_Universe
WHERE RIC IN ( ' + ''+ @LISTOFRICS + ''+ ')
AND DATECREATED > ''' + @PREVDAY + ''' AND DATECREATED < '''+@NEXTDAY+'''')

Thanks
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.

AnswerRe: Passing string to stored procedure. Pin
meeram3951-Jul-10 23:24
meeram3951-Jul-10 23:24 
Questiondisplay analog clock Pin
Hemant Thaker1-Jul-10 21:01
Hemant Thaker1-Jul-10 21:01 
AnswerRe: display analog clock Pin
Peace ON1-Jul-10 21:22
Peace ON1-Jul-10 21:22 
QuestionHow to Find character in ArrayList Pin
raju_shiva1-Jul-10 19:59
raju_shiva1-Jul-10 19:59 
AnswerRe: How to Find character in ArrayList Pin
ramzg1-Jul-10 20:11
ramzg1-Jul-10 20:11 
AnswerRe: How to Find character in ArrayList Pin
Keith Barrow1-Jul-10 21:06
professionalKeith Barrow1-Jul-10 21:06 
AnswerRe: How to Find character in ArrayList Pin
DaveyM692-Jul-10 1:24
professionalDaveyM692-Jul-10 1:24 
Questionnamespace name 'ArrayList' could not be found Pin
raju_shiva1-Jul-10 18:48
raju_shiva1-Jul-10 18:48 
AnswerRe: namespace name 'ArrayList' could not be found Pin
Abhinav S1-Jul-10 18:56
Abhinav S1-Jul-10 18:56 
QuestionHow to find the character in list Pin
raju_shiva1-Jul-10 18:15
raju_shiva1-Jul-10 18:15 
AnswerRe: How to find the character in list Pin
Abhinav S1-Jul-10 18:53
Abhinav S1-Jul-10 18:53 
Generalget the list of all page labels(numbers) Pin
TweakBird1-Jul-10 17:45
TweakBird1-Jul-10 17:45 
QuestionUnhandled exception handler problem Pin
Super Lloyd1-Jul-10 15:45
Super Lloyd1-Jul-10 15:45 
AnswerRe: Unhandled exception handler problem Pin
Luc Pattyn1-Jul-10 17:05
sitebuilderLuc Pattyn1-Jul-10 17:05 
GeneralRe: Unhandled exception handler problem Pin
Super Lloyd1-Jul-10 19:16
Super Lloyd1-Jul-10 19:16 
QuestionVS2010 Chart Control [modified] Pin
It_tech1-Jul-10 8:54
It_tech1-Jul-10 8:54 
AnswerRe: VS2010 Chart Control PinPopular
Pete O'Hanlon1-Jul-10 13:13
mvePete O'Hanlon1-Jul-10 13:13 

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.