|
the exception is caught in the line
picturebox.image=new bitmap(fs)
where fs is filestream
This code was posted by me...
|
|
|
|
|
NullReferenceException is caught in that line
This code was posted by me...
|
|
|
|
|
well if you add a break what object is null? The PictureBox? The Image? or the Bitmap?
Can you put in code to verify the file exists...
if(File.exists("filepath"))
//show message
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
i don knwo wht is happening,The file is created. that i can see when when i browse the folder. but null reference exception is shown when i run applcn.
here is the code
FileStream fs = File.Open("\\Program Files\\syswifi\\pic\\screen.Bmp",FileMode.Create);
ms.WriteTo(fs);
ms.Flush();
fs.Close();
ms.Close();
FileStream fstr = File.Open("\\Program Files\\syswifi\\pic\\screen.Bmp", FileMode.Open);
pictureBox1.Image = new Bitmap(fstr);
This code was posted by me...
|
|
|
|
|
What is it that is null thou?
OK what i suggest is you put a breakpoint after each line of code and check the status of each variable (also check the new bitmap once the first filestream has been closed)
you can also use a message box in each line and the pause the application for each one if you prefer.
Hopefully then you can confirm what value it is that is null and get somewhere from there
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
it worked...thanx
This code was posted by me...
|
|
|
|
|
Hello Experts!!
I am creating treeview at runtime also added node to treeview successfully but i dont know how to add child node to respective same node.
Help!!
|
|
|
|
|
|
I would assume you added the first node with...
TreeView1.Nodes.Add("a node");
Well, each node also has a collection of nodes so if you store the return value of the above method, or obtain the node with another method search as find then you can add nodes to the collection like...
TreeNode baseNode = TreeView1.Nodes.Add("Something");
baseNode.Nodes.Add("My First Child Node");
Hope that helps
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
hi
String domainAndUsername = domain + @"\" + username;
the above line is creating an exception looks pretty ok to me
domain and username are passed through the arguments in this function they are returning it well though
is concatenation a problem if done through this way
|
|
|
|
|
rhcp08 wrote: the above line is creating an exception looks pretty ok to me
English laguage has something called comma and full stop. It makes life easy to understand.
In between, what exception message are you getting? Would you explain in detail?
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
What exception are you getting? Do you have a null string by any chance?
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
hi
i have created a database by importing data from MS EXCEL in SQL server studio managemnt. but i am not locate on the disk .
when i tried to create database in the VISUAL studio 2005 by
Add New Item->SQLDATABASE
but it gives me an error that connection SQL SERVER 2005 requires it work properly. it is to be noted that i am in a professional company where all the software are installed and authenticated by professionals. where is the error?
1. first of all where the hell database is stored after creation in studio manager
2. how to connect my database with or without excat location of the database
(i can connect it if i know the location)
|
|
|
|
|
rhcp08 wrote: 1. first of all where the hell database is stored after creation in studio manager
C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data
rhcp08 wrote: 2. how to connect my database with or without excat location of the database
(i can connect it if i know the location)
With SQL Server, one connects to an alias on the server. This alias is mapped to a physical file. You can connect once you know the location of the server and the name of the database.
I are troll
|
|
|
|
|
Further to Eddy's comments. If you absolutely must know the location of the database:
In studio manager, select your database, right click on it and select properties from the context menu.
In the dialog that appears, select 'Files' from the left hand pane, then in the right pane scroll across to the Path column.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
rhcp08 wrote: it is to be noted that i am in a professional company where all the software are installed and authenticated by professionals.
Professional just means they get paid to do it. It does not mean they are any good. I've met many "professionals" that I would be surprised if they managed to find the "On" switch.
rhcp08 wrote: first of all where the hell database is stored after creation in studio manager
It gets created where ever you tell it to create it. If you don't there will be a default location depending on how it has been installed.
rhcp08 wrote: how to connect my database with or without excat location of the database
You should neither know nor should care where the database is physically stored as it can be stored in many different ways. You can store it in a file on the Hard Disk. You can split the database in to many files. You can store the database across disks. You can hand over entire hard disks to SQL Server and let SQL Server manage the entire disk (no file, just a disk).
You connect to a database, not a file (Except for SQL Server Express edition, which can treat a database as a file)
|
|
|
|
|
Hi all I am trying to sort a group in crystal report dynamically, the code I am using clears the grouping of the report here is the code I am using
{
SortFields targetSortField = Rpt.DataDefinition.SortFields;
DatabaseFieldDefinition fieldDef = Rpt.Database.Tables(0).Fields("List_Name");
targetSortField(0).Field = fieldDef;
targetSortField(0).SortDirection = CrystalDecisions.Shared.SortDirection.AscendingOrder;
}
Thanks.
Mohammad Al Hoss
Development To Me Is A Pleasure more than a Job
|
|
|
|
|
Anyone has any idea how can we establish a GPRS connection on a computer using a GSM modem. I know that creating a RAS connection would do the job and i am currently using the same method using RAS api, but i want to connect to GPRS through my application and establish a connection that other applications can use.
Something just like the dialer software that come with the GSM modems.....so any ideas on this one?
------------------------------
Sufian Mehmood Sheikh
sufian@my.web.pk
|
|
|
|
|
The differences are only in AT commands. Just look at the AT commands from your GSM modem.
|
|
|
|
|
yes, i know about AT commands also, but how will windows have an available connection. Have tried to send AT commands to the modem, the modem was connected on GPRS, an IP address was also assigned to the modem, but how will applications in windows would use that connection.....
------------------------------
Sufian Mehmood Sheikh
sufian@my.web.pk
|
|
|
|
|
|
Hi all,
i want to check the connectivity of my windows based mobile to my pc.
please tell me how can i use rapi for this.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
...and I fail at it And somehow I can't get a working answer on Google.
I want to store an in-memory generated assembly in the database for future use. I create this assembly from generated C#. For some reason, I can serialize the object, it generates a nice byte[] which is stored in the db. But when I want to retrieve the assembly for deserialisation to my object, I get an error like "{"Unable to find assembly '9-onzk69, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'."}"
My serialization routine is:
public byte[] Formula2ByteArray(Compiler.CompiledFormula formula)
{
byte[] result = null;
try
{
System.IO.MemoryStream mStream = new System.IO.MemoryStream();
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter formatter =
new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
formatter.Serialize(mStream, formula);
result = mStream.ToArray();
}
catch (System.Exception ex)
{
throw ex;
}
return result;
}
And my deserialisation code is:
public CompiledFormula LoadFormulaFromAssembly(byte[] array)
{
try
{
Compiler.CompiledFormula formula;
using (System.IO.MemoryStream stream = new System.IO.MemoryStream(array))
{
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter formatter =
new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
formula = (CompiledFormula)formatter.Deserialize(stream);
}
return formula;
}
catch (System.Exception ex)
{
throw ex;
}
}
Both the application which saves it into the db and the application which uses it contain the same libraries, so the objects-structures are known to both apps. De serialisation/deserialisation routines are in the same library/class working with the same object model.
What am I missing? If I do something stupid, just tell me
The consumer isn't a moron; she is your wife.
|
|
|
|
|
The answer might be stupid as well
Just a thought, if you need to Serialize an object shouldnt that be marked with the attribute "[Serializable]"?
Hariharan.T
|
|
|
|
|
The relevant classes are marked as Serializable, as otherwise the error would be notifying me which class is not serializable. This is not the case however, thus the serialize-attribute is set correctly.
The consumer isn't a moron; she is your wife.
|
|
|
|