|
thanks alot, I've almost managed that by now. and I deleted those columns as well.
now theres only onw nullreference Exception left. I'll deal with that pretty soon as well.
thanks
|
|
|
|
|
Hello! I/m developing Outlook 2003 add-in in c#? so I have some queer problems.
As you know, SenderName and ReceivedTime properties of PostItem object are read-only, so if you create such item programmatically, you'll see "Unknown".
Question is: are there any ways to set these properties? I've found one - MAPI. I set PR_SENDER_NAME,
but it works queer: if i open postitem i see my phrase, but in the message folder i see "unknown" in the title of each postitem. ()
And i tryed to set RecievedTime in such a way - in vain.
I would greatly appreciate any help!
If anybody can help, i can show the code.
Looking forward for your answers!
|
|
|
|
|
Hi,
I declared a hidden field in my .aspx page like such:
<asp:HiddenField id="hdnHubID" runat="server" />
I populated the value property of the hidden field like such:
hdnHubID.Value = objOrder.Hub.ToString(); // Contains the integer hub ID
And I tried retrieving the value like this:
int intHubID = Int32.Parse(Request.Form["hdnHubID"]);
Then I get the following error in my browser:
System.ArgumentNullException: Value cannot be null.
Parameter name: String
... and it hightlights int intHubID = Int32.Parse(Request.Form["hdnHubID"]); in red.
What is this error and why am I getting it??
Regards,
ma se
|
|
|
|
|
why are not using hdnHubID.Value to retrieve the value.
try
int intHubID = Int32.Parse(hdnHubID.Value);
Regards
Shajeel
|
|
|
|
|
Thanks, but I don't understand the difference between the 2. The reson why I took Request.Form was because I am populating text fields depending on what winery is selected from the drop down, but the hub ID will always remain the same.
|
|
|
|
|
You have declared it as server side so it is available to you without Request.Form. i have .net 1.1 so i can't code it right now. but i think it will also be avialable from Request.Form. the main difference b/w the 2 is Request.Form is used when the control is client side and you dont have any access to it from your class.
Regards
Shajeel
|
|
|
|
|
You're gettind a null reference exception becaue the Request.Form["hdnHubID"] is unable to retrieve to control and it returns null which is passed to Int32.Parse that expects a string. You should check for null reference exceptions.
regards,
Mircea
Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.
|
|
|
|
|
I am working with C#.net and i want to extract all the projects path that are stored inside the solution file and i also want to read the number of projects that are references and those that are associated with the Source safe control.
Plz help me as soon as possible.
|
|
|
|
|
open the the sln file with a text editor and it`s easy enough to find out the format of a sln file. So you could write a parser yourself if you will.
The references of each project you can get from their respective .csproj file, which is an XML file, even easier to parse that...
A nice tool that interprets all that for you is Visual Studio, really cool tool, and it has a nice GUI that makes it easy to find the references of each project and such
Greetz,
Davy
|
|
|
|
|
Hi,
What class/Method can be used as an equivalent for PixelGrabber in Java?
i need to retrieve the subset of pixels from an Image in Windows Application
Kindly tell me..
Thanx..
|
|
|
|
|
Read my image processing articles.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
What is the difference between const and read-only variable?
|
|
|
|
|
Consts must be asigned at compilation; this means that every time you run the programe they have the same value.
Read only can be asigned a value when they are declared and they can't be changed afterwards; this works "readonly int j=i" where i is a variable. So j can have different values the programe is run;
|
|
|
|
|
Hi,
The difference is --
The value of const is evaluated at compile time and the value of readonly are evaluated at runtime.
Means u cannot assign value to const at runtime like this --
const int a = someVariable;
but you can do --
readonly int a = someVariable;
<marquee>"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
Anant Y. Kulkarni
|
|
|
|
|
Hello Anant,
Anant Y. Kulkarni wrote: const int a = someVariable;
'someVariable' or must have some constant value?
if i changed value of someVariable before upper statement then it will be runtime binding.
Isn't it?
regards,
Divyang Mithaiwala
System Engineer & Software Developer
|
|
|
|
|
Hi,
The difference is --
The value of const is evaluated at compile time and the value of readonly are evaluated at runtime.
Means u cannot assign value to const at runtime like this --
const int a = someVariable;
but you can do --
readonly int a = someVariable;
I meant that you cannot assign a variable to a const. It should be a constant like --
const int a= 50
I just wrote the opposite.
<marquee>"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
Anant Y. Kulkarni
|
|
|
|
|
You also keep in mind the limitations of const vs. read-only.
In the case that you have an assembly you distribute, internally or to customers, that contains CONST values. Since CONSTs are set at compile time, if you update your values and distribute the updated assembly unless the apps are recompiled with your new assembly they will still have the old vlaues for the CONST variables.
only two letters away from being an asset
|
|
|
|
|
Taken from the MSDN[^] documentation for the readonly keyword:
When a field declaration includes a readonly modifier, assignments to the fields introduced by the declaration can only occur as part of the declaration or in a constructor in the same class.
A const field can only be initialized at the declaration of the field. A readonly field can be initialized either at the declaration or in a constructor. Therefore, readonly fields can have different values depending on the constructor used. Also, while a const field is a compile-time constant, the readonly field can be used for runtime constants.
|
|
|
|
|
How will you create a 64–bit application using Visual Studio .NET 2003?
|
|
|
|
|
Set the Platform Target in the project properties to x64
only two letters away from being an asset
|
|
|
|
|
That'll work for C# in Visual Studio.NET 2005, but not in VS.NET 2003.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi All
How I can Use Thread with ListView To Add this Items
ListViewItem lvi = new ListViewItem(new string[] { splitString[1], splitString[2].Substring(0, 12), splitString[2].Substring(17, 12), tempstring }); <br />
this.listView1.Items.Add(lvi);
|
|
|
|
|
Hi,
You can create new object of Thread class and assign a function which will perform the above said operation for you. Remember that the function should not return any thing (ie return type = void ) and should not accept any arguments. In case if you want to pass some arguments when the thread will actually start then you can use fields or properties which would be accessible from inside the function. For example --
Thread objThread = new Thread(new ThreadStart(this.FunctionName));<br />
objThread.Start();
the FunctionName would be your function defined as below--
public void FunctionName()<br />
{<br />
ListViewItem lvi = new ListViewItem(new string[] { splitString[1], splitString[2].Substring(0, 12), splitString[2].Substring(17, 12), tempstring });<br />
this.listView1.Items.Add(lvi);<br />
}<br />
If you want now to pass any arguments to FunctionName then use fields or properties. Means before u call objThread.Start() assign the right fields with the values you want to pass to the Thread.
Hope i am clear !
<marquee>"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
Anant Y. Kulkarni
|
|
|
|
|
thanks Anant Y. Kulkarni
I am use this code
private void loadSubToolStripMenuItem_Click(object sender, EventArgs e)<br />
{<br />
<br />
OpenFileDialog1.Filter= "Srt File|*.srt";<br />
OpenFileDialog1.Title = "Open SubTitle File";<br />
try<br />
{<br />
if (OpenFileDialog1.ShowDialog() == DialogResult.OK)<br />
{<br />
Thread ReadThread = new Thread(new ThreadStart(ReadData));<br />
ReadThread.Start();<br />
}<br />
}<br />
catch (Exception)<br />
{<br />
MessageBox.Show("Can't Read this File");<br />
}<br />
}
and this Function
private void ReadData()<br />
{<br />
listView1.Items.Clear();<br />
StreamReader s = new StreamReader(OpenFileDialog1.FileName, Encoding.Default);<br />
ArrayList a = new ArrayList();<br />
while (s.Peek() >= 0)<br />
{<br />
string alltext = "";<br />
string text = "";<br />
while ((text = s.ReadLine()) != "" && text != null)<br />
{<br />
alltext += ("|" + text);<br />
}<br />
a.Add(alltext);<br />
}<br />
s.Close();<br />
foreach (string text in a)<br />
{<br />
string[] splitString = text.Split('|');<br />
string tempstring = "";<br />
for (int i = 3; i < splitString.Length; i++)<br />
{<br />
tempstring += splitString[i];<br />
}<br />
ListViewItem lvi = new ListViewItem(new string[] { splitString[1], splitString[2].Substring(0, 12), splitString[2].Substring(17, 12), tempstring }); <br />
this.listView1.Items.Add(lvi);<br />
}<br />
a.Clear();<br />
}
when i Run this Program this message Dispaly
Exception System.InvalidOperationException was thrown in debuggee:
Cross-thread operation not valid: Control 'listView1' accessed from a thread other than the thread it was created on
|
|
|
|
|