Click here to Skip to main content
15,905,232 members
Home / Discussions / C#
   

C#

 
GeneralRe: help me please i really cant solve it Pin
tatchung24-Aug-05 15:23
tatchung24-Aug-05 15:23 
GeneralRe: help me please i really cant solve it Pin
tatchung24-Aug-05 16:35
tatchung24-Aug-05 16:35 
GeneralRe: help me please i really cant solve it Pin
nidhelp24-Aug-05 20:24
nidhelp24-Aug-05 20:24 
GeneralRe: help me please i really cant solve it Pin
nidhelp24-Aug-05 23:39
nidhelp24-Aug-05 23:39 
AnswerRe: help me please i really cant solve it Pin
Muammar©11-Nov-06 21:18
Muammar©11-Nov-06 21:18 
GeneralListboxes to datasets Pin
towneytowney23-Aug-05 21:47
towneytowney23-Aug-05 21:47 
GeneralListboxes to datasets Pin
towneytowney23-Aug-05 21:46
towneytowney23-Aug-05 21:46 
GeneralSystem.NullReferenceException Pin
oneyard23-Aug-05 21:34
oneyard23-Aug-05 21:34 
I know there are so many question regarding this NullReferenceException...
but still i couldn't find any solution for my prob...
i've got a runtime error...
it says that...
"An unhandled exception of type 'System.NullReferenceException' occurred in OraGraphing.exe
Additional information: Object reference not set to an instance of an object."


this is my code... the error is at price...


<br />
public int counter;<br />
public sting[] price;<br />
<br />
private void Form1_Load(object sender, System.EventArgs e)<br />
{<br />
	OracleConnection oraConn = new OracleConnection("Data Source=quotes; user id=me; password=you;");<br />
	OracleCommand oraCmd = new OracleCommand("SELECT isin, to_char(trading_date,'dd/mm/yy hh24:mi:ss'), last_done_price FROM realtime_tracking",oraConn);<br />
	oraConn.Open();<br />
	OracleDataReader oraDR = oraCmd.ExecuteReader();<br />
<br />
	counter = 0;<br />
	while(oraDR.Read())<br />
	{				<br />
		try<br />
		{<br />
			price[counter] = oraDR["last_done_price"].ToString(); // <-- error here..<br />
		}<br />
		catch (NullReferenceException nre)<br />
		{<br />
			MessageBox.Show(nre.Message);<br />
		}<br />
		counter++;<br />
	};<br />
<br />
	oraDR.Close();<br />
	oraConn.Close();<br />
}<br />


I think that error because of i didnt declare how large the array is... but how? since i didnt know how large is the data inside that database...


-----------------------------------------------
=^_^= I'm a noob whose trying to learn... =^_^=
GeneralRe: System.NullReferenceException Pin
Colin Angus Mackay23-Aug-05 21:50
Colin Angus Mackay23-Aug-05 21:50 
GeneralRe: System.NullReferenceException Pin
oneyard23-Aug-05 22:09
oneyard23-Aug-05 22:09 
GeneralRe: System.NullReferenceException Pin
Colin Angus Mackay23-Aug-05 22:17
Colin Angus Mackay23-Aug-05 22:17 
GeneralRe: System.NullReferenceException Pin
leppie23-Aug-05 21:57
leppie23-Aug-05 21:57 
GeneralRe: System.NullReferenceException Pin
Guffa23-Aug-05 22:14
Guffa23-Aug-05 22:14 
GeneralRe: System.NullReferenceException Pin
V.24-Aug-05 0:49
professionalV.24-Aug-05 0:49 
GeneralRe: System.NullReferenceException Pin
V.24-Aug-05 0:53
professionalV.24-Aug-05 0:53 
GeneralNetwork Management Pin
Member 199534123-Aug-05 21:27
Member 199534123-Aug-05 21:27 
QuestionHow to listen connection request on 80 port Pin
Gagan Deep Singla23-Aug-05 19:45
Gagan Deep Singla23-Aug-05 19:45 
AnswerRe: How to listen connection request on 80 port Pin
mav.northwind23-Aug-05 19:59
mav.northwind23-Aug-05 19:59 
GeneralRe: How to listen connection request on 80 port Pin
Gagan Deep Singla23-Aug-05 20:11
Gagan Deep Singla23-Aug-05 20:11 
GeneralRe: How to listen connection request on 80 port Pin
S Douglas23-Aug-05 21:09
professionalS Douglas23-Aug-05 21:09 
GeneralRe: How to listen connection request on 80 port Pin
Gagan Deep Singla24-Aug-05 20:33
Gagan Deep Singla24-Aug-05 20:33 
GeneralRe: How to listen connection request on 80 port Pin
mav.northwind23-Aug-05 21:23
mav.northwind23-Aug-05 21:23 
GeneralRe: How to listen connection request on 80 port Pin
Gagan Deep Singla24-Aug-05 20:42
Gagan Deep Singla24-Aug-05 20:42 
GeneralRe: How to listen connection request on 80 port Pin
Colin Angus Mackay23-Aug-05 21:38
Colin Angus Mackay23-Aug-05 21:38 
GeneralRe: How to listen connection request on 80 port Pin
Gagan Deep Singla24-Aug-05 20:48
Gagan Deep Singla24-Aug-05 20:48 

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.