Wrox Programmer Forums
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 12th, 2013, 03:32 AM
Registered User
 
Join Date: Jul 2013
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Array

Hi, Iam am fairly new to the c# Environment - therefore forgive a (maybe simple) question: I do Windows Programming and try to output an Array - length 40 - to Display thru' a 'textBoxOutput.Text'. Whatever I tried there is always an incompatibility between my Array and the TextBox. Can anybody please suggest an answer.
 
Old July 12th, 2013, 05:02 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Strings and arrays of strings are not directly compatible and thus you can't assign an array to a string property. You can use the Join method (http://msdn.microsoft.com/en-us/library/57a79xd0.aspx) to convert the string into an array.

Hope this helps,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old July 13th, 2013, 11:17 AM
Registered User
 
Join Date: Jul 2013
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default c# Arrays

Hi Imar,
Thank you very much for your fast reply: Inbetween, I tried out - and was rather successful - to approach my Problem via the 'stringbuilder' (sb) method. Everything works -- bar an unwanted side-effect of my Project: the TextBox Output.text isn't text but in hex. Would you have a hint...? Apparently there is a prior Convert.To... (from sb-hex totextBoxOutput.Text) required -- which one?
I am sure you know the solution - and this umpteen times faster and productive than me looking this up in the Internet.
Thanks again
Peter
 
Old July 13th, 2013, 02:02 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

>> I am sure you know the solution - and this umpteen times faster and productive than me looking this up in the Internet.

Not without seeing your code and a description of your application / setup....

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old September 1st, 2013, 12:09 AM
Registered User
 
Join Date: Sep 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

How could I build an array?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Convering a String Array to an Integer array nkrust C# 9 November 17th, 2010 12:02 PM
I am have been trying to assign a c# array value to a javascript array ysfkay ASP.NET 3.5 Professionals 10 April 7th, 2010 07:46 AM
Go from 2d Array to 1d array without defining type OneQuestion General .NET 1 January 10th, 2008 11:13 AM
error when sorting an Array of Array nancy VBScript 2 February 17th, 2005 12:57 PM
Passing php array values to javascript array gkrishna Pro PHP 0 November 6th, 2004 03:20 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.