|
thanks for the code but at run time a error is thrown saying
""'"Data type mismatch in criteria expression."'''"
if u have any idea abt this error please let me know
regards
sindhu tiwari
its me sid
|
|
|
|
|
Use the debugger, step through the code and see where the exception is thrown.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
i dont have any idea abt the debugger step if u dont mind plz tell me
its me sid
|
|
|
|
|
sindhutiwari wrote: i dont have any idea abt the debugger step if u dont mind plz tell me
How can you be coding without knowing how to debug? There's a honking great menu in Visual Studio called Debug. Have a look at what it offers you.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
no problem in that.................
its me sid
|
|
|
|
|
My outlook add in is not loading in PC other than development PC.I tried all above points but still didn't succeed
1) Load behaviour is remain 3 after open outlook
2) In CAS add in has full trust rights
3) There is no error while opening outlook from commnad prompt after execute command set VSTO_SUPPRESSDISPLAYALERTS=0
All points that casue of error are OK but still not working
Please help me
Pritesh Patel
|
|
|
|
|
Hi everyone,
i have a treeview and a sqlserver table called companies. with company id, name, adress, and departments. I have the following code to set the company names in the treeviewnodes:
foreach (DataRow mydr in Sql.mydt.Rows)
{
treeView1.Nodes.Add(new TreeNode(mydr["Dep_comp_name"].ToString()));
}
now how can i set the departments(belonged to the company names) as childnodes to the companyname nodes ?
thanx.
|
|
|
|
|
Retain a reference to each TreeNode object that represents a company after it is created. Call the Nodes.Add method of that object for every department in the company.
Paul Marfleet
|
|
|
|
|
hi paul marfleet,
thanx for your response. i m very new in c# and i still don't understnad how to do that. cause one company can have more departments, how can i get those departments and set it to the node of the right company? Can u give me some code?
|
|
|
|
|
I'm not going to do your (home)work for you. If you want to learn C# or programming as a general discipline, you need to practice solving problems. Since my first post, you haven't demonstrated that you have made any further effort to solve the problem yourself.
I will give you some further pointers though.
1. Fetch your data in a fashion that allows you to easily iterate through i) companies ii) departments within companies
2. When iterating through companies, use a nested loop to iterate through the departments for a company.
3. Retain a reference to each company treenode you add to the tree in an object variable. Add your department nodes as children to each company treenode when iterating through departments for a company.
Paul Marfleet
|
|
|
|
|
As an example:
foreach (DataRow mydr in Sql.mydt.Rows)
{
TreeNode parent = new TreeNode(mydr["Dep_comp_name"].ToString());
parent.Nodes.Add(new TreeNode(mychilddr[...].ToString()));
treeView1.Nodes.Add(parent);
} This is an inefficient approach, but until you become more proficient it should help you. The important thing is that you will have to get the child rows from the database somehow, and add them to the Nodes collection of the company tree node.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete O'Hanlon,
Thank you, geat help. this helped me a lot.
|
|
|
|
|
I have a web application written using C# (visual studio 2002) which including the use of resource (only string data) but when I tried to edit the data displayed on the web page in the resource created...it makes no changes to the page when I refreshed it (or even after clearing the cache,etc). May I know how actually I can change the data so that it will reflect the changes to my web page as well? Please HELP...
Thanks in advance!
Alexia
|
|
|
|
|
I used a text file and just included the text file inside the web page by using
<!--#include virtual="/maincontent.txt"--><br>
inside the HTML code
Your resource shouldnt really matter as long as the page can access it. Check your resource and make sure it is updated properly (before the page reads it) and that all permissions are set correctly. The page will have to be refreshed too.
Hope this helps
I love programming!
|
|
|
|
|
Hi all,
I am developing a smartclient(mobile)Application.,
Here I need to make a textbox to behave in such a way that it should grow horizantally to the end of form from its normal sizeto nextline and so, once the cursor reaches the end.
I have taken normal textbox and made the workwrap to false...But I couldn't able to make the textbox to grow horzantally
Thanks,
Prashanth
|
|
|
|
|
heii for this u need t change the property of text box according to the text entering into it...
My small attempt...
|
|
|
|
|
Hi.
I want to plot the spectral diagram of a wav file onto a panel, which can be pretty long(the graph). The panel has a limited length, say 400 px. How can I add scroll bars to the Panel, so I can scroll back and forth to see the entire graph?
I know that the Panel has a property called Autoscroll, automatically adds H&V scroll bars if there are controls outside the visible area. But nothing similar happens if I programatically draw something outside the panel's client area.
Any ideas or suggestions?
Thanks.
|
|
|
|
|
Hi
Use DIV section instead of panel.
Add your diagram section inside DIV Section and you can set the size for width and height; add the style as OVERFLOW: auto;
Hope this solves your problem.
Harini
|
|
|
|
|
I forgot to mention that this is a Windows application, not a web site.
Thanks anyway.
|
|
|
|
|
Put a picture box control in a panel and set its SizeMode property to AutoSize and then set AutoScroll property of Panel to True.
Now draw your chart on Picture box instead of Panel.
However the most important point is that, in this scenario you will need to reset the width of Picture box according to the increasing size of Graph. Therefore you will have to measure the width of the drawn area and reset width of Picture Box.
Following is a small code snippet which I used to test, it draws a long string on a Picturebox and Panel will show scroll bar as expected.-
------------------Code Start------------------------------------------------------
private void PictureBox1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
Graphics g = e.Graphics;
string str = "JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmJJJJJJJJJJJ";
g.DrawString(str, new Font("Arial", 14, FontStyle.Bold, GraphicsUnit.Pixel), Brushes.Black, 50, 50);
this.PictureBox1.Width = g.MeasureString(str, new Font("Arial", 14, FontStyle.Bold, GraphicsUnit.Pixel)).Width + 4;
}
-------------Code End--------------------------------------
I hope this will help you in finding the exact resolution.
-Dave.
Dave Traister,
ComponentOne LLC.
www.componentone.com
|
|
|
|
|
Thank you! You saved my day and got my 5.
|
|
|
|
|
Hi,
I wish to run multiple exe's using the single object of System.Diagnostics.Process class. Is it possible?
Though the other way is to make a string array containing the file names and then loop through these filenames and pass the name in the ProcessStartInfo.
If anybody has a better solution, kindly let me know.
Thanks
-----Have A Nice Day-----
|
|
|
|
|
I am having a rather weird problem with the display of information in a standard combo box. The original problem was that there was a need to toggle between two different views for the items in the combo box (say, a long name and a mnemonic). So I added a check box to the form and configured it so that the contents of the combo box are cleared out and re-added in the selected state each time the check box's checked state changes.
Upon implementation, I noticed immediately that when toggling between the two states, the whole combo box control disappears from the form (not just goes empty) when the combo box is cleared and only reappears shortly after (presumably after the first item is re-added). Some trial and error pointed me to its AutoCompleteSource property which is set to ListItems. Changing this property to something else (say, HistoryList) avoids the disappearing combo box problem, the combo box merely becomes empty and is then filled up with the items that are re-added in (as is expected). Does anyone know a workaround for this (as I would like to keep AutoCompleteSource to ListItems)? I have tried changing the AutoCompleteSource before clearing the combo box and then resetting it after but that didn't work...
cheers!
|
|
|
|
|
Hi,
I'm trying to initialize a nullable object at runtime..for that i'm using
object childnullable = System.Runtime.Serialization.FormatterServices.GetSafeUninitializedObject(Type);
The above one works fine for a normal nullable object but when it is a nullable array object it's throwing exception ...Plz help me to initialize that...
Koushik
|
|
|
|
|
Spunky Coder wrote: when it is a nullable array object it's throwing exception
What kind of exception? Can you post whole exception message and stack trace?
[ My Blog] "Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - Rüdiger Klaehn "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|