Click here to Skip to main content
15,922,533 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# and mysql Pin
Christian Graus10-Nov-05 13:33
protectorChristian Graus10-Nov-05 13:33 
GeneralRe: C# and mysql Pin
vandread110-Nov-05 13:39
vandread110-Nov-05 13:39 
GeneralRe: C# and mysql Pin
Christian Graus10-Nov-05 13:53
protectorChristian Graus10-Nov-05 13:53 
QuestionSocket question Pin
Tom Wright10-Nov-05 12:40
Tom Wright10-Nov-05 12:40 
AnswerRe: Socket question Pin
User 58385210-Nov-05 16:40
User 58385210-Nov-05 16:40 
GeneralRe: Socket question Pin
Tom Wright11-Nov-05 4:55
Tom Wright11-Nov-05 4:55 
GeneralRe: Socket question Pin
Tom Wright12-Nov-05 3:20
Tom Wright12-Nov-05 3:20 
QuestionCaching multiple ArrayLists Pin
Rlearning10-Nov-05 12:40
Rlearning10-Nov-05 12:40 
Problem with Caching mutiple ArrayLists using a ToString value for
the name. The reason I am doing this is that I Cache.Insert multiple
arrays but if they all have the same array name they will all have the
same array (i.e. last array saved). I know I can hard code every set in the database, but I'm trying to make this code Dynamic for the long run.

I cannot seem to be able to extract the value from within the
"tmpfieldName" variable when I create an ArrayList
      [e.g. ArrayList tmpfieldName.ToString() = new ArrayList();]

The data that is in the the SQL table consists of 2 columns. The first
column contains a fieldname value and the second column contains the fieldCode
value. This data is used in dropdown lists within multiple web pages.
It looks like:
fieldName fieldCode
name      bob
name      Ron
name      Chuck
hair      brown
hair      blond
hair      grey ... and so forth.

When I use the code below it returns a "Compiler Error Message: CS1002: ; expected"."

What method should I be using to get the string value for an ArrayList name?
I have tried this using a DataSet and DataTable[index} to cache and it does the same thing.

Thanks for any ideas

--------------------- sample code to load mutilple arrays --------------------------

SqlConnection dbConnection = new SqlConnection("server=" +cServer+";database=*********;
   User ID=*********; Password=********");
SqlCommand mCommand = new SqlCommand("SELECT fieldName,fieldCode FROM dbo.AaFieldCodes
   ORDER BY dbo.AaFieldCodes.fieldName", dbConnection);
dbConnection.Open();
SqlDataReader mReader = mCommand.ExecuteReader(CommandBehavior.CloseConnection);
string tmpfieldName = "firstGroup";

try
{
// Iterate through all returned records
 bool firstRecord = true;
 while(mReader.Read())
  {
   if (tmpfieldName = "firstGroup")
   {
      tmpfieldName = mReader.GetValue(0).ToString();
      ArrayList tmpfieldName.ToString() = new ArrayList();
   }
   if (tmpfieldName != mReader.GetValue(0).ToString())
   {
      _cache.Insert(tmpfieldName, tmpfieldName.ToString());
      tmpfieldName = mReader.GetValue(0).ToString();
      ArrayList tmpfieldName.ToString() = new ArrayList();
   }
   tmpfieldName.ToString().Add (mReader.GetValue(1).ToString());
  }
}

finally
   {
   _cache.Insert(tmpfieldName, tmpfieldName.ToString());
   mReader.Close();
   }
AnswerRe: Caching multiple ArrayLists Pin
Christian Graus10-Nov-05 13:06
protectorChristian Graus10-Nov-05 13:06 
GeneralRe: Caching multiple ArrayLists Pin
Rlearning11-Nov-05 6:00
Rlearning11-Nov-05 6:00 
GeneralRe: Caching multiple ArrayLists Pin
Christian Graus13-Nov-05 9:48
protectorChristian Graus13-Nov-05 9:48 
Questioncheckedlistbox highlight and spacing Pin
SeanCM10-Nov-05 12:29
SeanCM10-Nov-05 12:29 
AnswerRe: checkedlistbox highlight and spacing Pin
whizzs11-Nov-05 8:49
whizzs11-Nov-05 8:49 
QuestionProblems with tabcontrol Pin
ika210-Nov-05 12:23
ika210-Nov-05 12:23 
QuestionHow to Get MouseEnter to Work With Mouse Button Down Pin
redfish3410-Nov-05 11:49
redfish3410-Nov-05 11:49 
QuestionA similar action to a try catch statement? Pin
Kuira10-Nov-05 11:49
Kuira10-Nov-05 11:49 
AnswerRe: A similar action to a try catch statement? Pin
Christian Graus10-Nov-05 12:42
protectorChristian Graus10-Nov-05 12:42 
GeneralRe: A similar action to a try catch statement? Pin
Kuira10-Nov-05 13:25
Kuira10-Nov-05 13:25 
GeneralRe: A similar action to a try catch statement? Pin
Christian Graus10-Nov-05 13:27
protectorChristian Graus10-Nov-05 13:27 
GeneralRe: A similar action to a try catch statement? Pin
Kuira10-Nov-05 13:46
Kuira10-Nov-05 13:46 
GeneralRe: A similar action to a try catch statement? Pin
Leslie Sanford10-Nov-05 18:47
Leslie Sanford10-Nov-05 18:47 
GeneralRe: A similar action to a try catch statement? Pin
Kuira13-Nov-05 12:15
Kuira13-Nov-05 12:15 
GeneralRe: A similar action to a try catch statement? Pin
Leslie Sanford13-Nov-05 13:11
Leslie Sanford13-Nov-05 13:11 
GeneralRe: A similar action to a try catch statement? Pin
Kuira13-Nov-05 17:05
Kuira13-Nov-05 17:05 
GeneralRe: A similar action to a try catch statement? Pin
Leslie Sanford13-Nov-05 17:37
Leslie Sanford13-Nov-05 17:37 

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.