473,385 Members | 1,531 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Cannot insert or append joint array of stringbuilder

i can not insert or append in an array of stringbuilder element as well as a joint one that has the form
stringbuilder [,] str=new stringbuilder[20,2];
for an example
and in every time i had an exception saying
exception {"Object reference not set to an instance of an object."} System.Exception {System.NullReferenceException}
i need a very fast solution please and thank you
new member
samira388
Mar 23 '10 #1
2 1841
tlhintoq
3,525 Expert 2GB
"How do I fix a 'object reference not set to an instance of an object' error?
The line your code stopped on while debugging holds all your answers.
One of the variables/objects was created but not initialized. For example:
Expand|Select|Wrap|Line Numbers
  1. string TempString;// Created but not initialized so this is still null
  2. //versus
  3. string TempString = string.empty;
Debug your project again. This time, when it breaks on a line look at the Locals pallet to see which variable/object is null. You can also hover your mouse over each variable and the hothelp will shows its value. One of them will be null.
Mar 23 '10 #2
thanks your answer helps me a lot
Mar 24 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

19
by: John Keeling | last post by:
Dear all, I tried the test program below. My interest is to examine timing differences between insert vs. append & reverse for a list. My results on my XP Python 2.3.4 are as follows:...
9
by: cody | last post by:
Why isn't there an StringBuilder.Append() overload with a StringBuilder as argument? Is there a reason that I missed?
3
by: todorov-fkt | last post by:
Hello Provided the following code: string temp = "Short string"; // 12 chars StringBuilder sb = new StringBuilder(); sb.Append(temp, 0, 30); How many characters is the string in sb? 12 or is...
3
by: Chris | last post by:
Hi, I have the following procedure below: I am getting 2 errors on compile: Argument '2': cannot convert from 'System.Data.SqlClient.SqlDataReader' to 'ref...
2
by: Roy Gourgi | last post by:
Hi, I am trying to insert a record into my database by using parameters, but I get the error message System.Data.SqlClient.SqlException. Here is my code below. TIA Roy
0
by: Arne Adams | last post by:
Hi changing a StringBuilder through a deduced type throws an exception - Sample Code void editBuilder(System::Text::StringBuilder* t System::String* insertThis = S"inserted"...
3
by: David | last post by:
All If I have a SQL statmenet as illistarted below what is the best way to append parameters to the command. Dim sql As Text.StringBuilder sql.Append("INSERT Table ") sql.Append("(col1,...
6
by: Simon | last post by:
Hi folks, I'm aware of the fact that using a StringBuilder is more efficient than constantly reassigning a string. For example. Example A --------- SringBuilder sb = new StringBuilder();...
5
by: xzzy | last post by:
I am writing an app that enables a user to reply to a newsgroup. The proper syntax for From: is "screen name" email@address.com and over all, it should look like: --
1
by: qwedster | last post by:
Hi! Every time when I want to add a row, I call this method in the code snippet to get the next identity value. Code Snippet: private int GetNextRowID() { int NextRowID =0;
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.