|
If you're using .NET 2.0, you can use the WebBrowser[^] control to the display the table on your form or composite control.
|
|
|
|
|
.Net 1.1, Is there any way to do this over there?
|
|
|
|
|
I have a crystal report done and I am trying to call that thru win forms.I use VS 2005 and C#.
I get one error msg telling 'Load report failed'.I have 2 parameters to pass to the report.I use a stored procedure for the report.My code is given below:
The line doc.load() which loads the report is showing the error:
if (cmbLocation.SelectedIndex == 0)
cmbLocation.SelectedValue = "NULL";
else
cmbLocation.SelectedValue = cmbLocation.SelectedItem.ToString();
if (cmbDept.SelectedIndex == 0)
cmbDept.SelectedValue = "NULL";
else
cmbDept.SelectedValue = cmbDept.SelectedItem.ToString();
string reportPath = Application.StartupPath + "\\" + "crAbsenceToday.rpt";
//Instantiate variables
CrystalDecisions.CrystalReports.Engine.ReportDocument doc = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
ParameterField paramField = new ParameterField();
ParameterFields paramFields = new ParameterFields();
ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();
//Set instances for input parameter 1 - @DEPTNAME
paramField.Name = "@DEPTNAME";
paramDiscreteValue.Value = cmbDept.SelectedValue;
paramField.CurrentValues.Add(paramDiscreteValue);
//Add the paramField to paramFields
paramFields.Add(paramField);
//Set instances for input parameter 2 - @LOC
paramField = new ParameterField();
paramField.Name = "@LOC";
paramDiscreteValue = new ParameterDiscreteValue();
paramDiscreteValue.Value = cmbLocation.SelectedValue ;
paramField.CurrentValues.Add(paramDiscreteValue);
//Add the paramField to paramFields
paramFields.Add(paramField);
crv1.ParameterFieldInfo = paramFields;
doc.Load(reportPath);
//Load the report by setting the report source
crv1.ReportSource = doc;
I am trying to solve this for the last 4 days...plz help me to sort it out.
Thanks in advance.
|
|
|
|
|
Hi,
In SharpDevelop 1, when it would "fold" a class, it would do it the same way it does a method, where the [...] was at the end of the declaration, like this:
public class TestClass [...]
Now, in SharpDevelop 2.0, when you fold a class, it just displays the [...], and hides the class declaration. That is very annoying, is there any way to change that?
Any help would be appreciated.
|
|
|
|
|
I have the following code:
try
{
statusLabel.Text = "Attemting to connect...";
DataCon.Open();
....
}
Why dosn't "Attempting to connect..." show in the status bar until it has connected?
|
|
|
|
|
Use Application.DoEvents()
<br />
try<br />
{<br />
statusLabel.Text = Attempting to connect..."; Application.DoEvents();<br />
DataCon.Open();<br />
}<br />
Basically calling the Application.DoEvents() forces your application to process everything up that point before proceeding to the next step in your code. Without it your user interface will appear to lock up until your done working with your data connection stuff. The other way to accomplish this would be to spawn your data connection stuff on another thread which then would make the main thread process the UI changes.
I reject your reality and substitute my own!
- Adam Savage, Mythbuster
-George W Bush
life is like a roll of toilet paper. The closer it gets to the end, the faster it goes.
My definition of an expert in any field is a person who knows enough about what's really going on to be scared.
- PJ Plauger
|
|
|
|
|
Thanks! Thought it would be something small like that. Works fine now
|
|
|
|
|
the StatusBar component is a little tricky. Does your StatusBar have panels? If so you should be addressing the panel to which you want the data to appear. For example, say you had statusBar1 and statusBarPanel1 defined in your app. Use statusBarPanel1.Text = "blah blah blah".
Good luck
Mike Luster
CTI/IVR/Telephony SME
|
|
|
|
|
I am trying to supply an hDC to a dll that needs a picture drawing area. I think i have 2 choices:
1. Use Form1 itself and just specify where the dll should draw the object.
2. Use a PictureBox1.
I do not understand the structures well enough to know if i can:
a. use the windowHandle of Form1 as an hDC.
--- Does the windowHandle qualify as an hDC? If not, how can i get a suitable hDC for Form1?
b. get the hDC of pictureBox1.
--- I need the hDC in an event-handler (a Form1 keypress event) that does not have access to an e argument that allows: hdc = e.Graphics.GetHdc(); .
All suggestions are welcome.
Thank you.
|
|
|
|
|
A window handle cannot be used as a hDC (device context).
If you want to get the hDC for any control or form, use something similar to this:
Graphics g = [this/pictureBox1].CreateGraphics();
g.GetHdc();
|
|
|
|
|
You'll need to give us more information about what you want and need to do before we can help. Your description is rather vague.
What re you using to create the line graph? What database engine are you proposing to use?. What is this 24 hour time contraint? etc...
Is this perhaps for an assignment, project, or real-world application?
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
(Translation: I'll show you the way, but not write the code for you.)
|
|
|
|
|
my problem is how can i tracks a server's response times and records the results of all monitoring requests into its built-in database. using Historic monitoring data and can analyzed for uptime/down time reports and trend analysis.
need help... thanks in advance.
|
|
|
|
|
Don't reinvent the wheel if you don't need to. A Google search[^] for DB performance monitoring tools which use Windows Performance Monitor data shows that several are available.
If you really need to roll your own, then you'll need to research how to interect with the Perfomance Counters (just type in performance counters into the Code Project search bar at the top of the page for several articles on how to do this).
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
(Translation: I'll show you the way, but not write the code for you.)
|
|
|
|
|
i am trying to get the ip address of host on windows application
thanks
openup your heart and let the sun shine in
|
|
|
|
|
Try these search terms in The Code Project search...
ip address of host
You will find plenty of hits. One of them is bound to do what you want or at the very least point you in the right direction.
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
(Translation: I'll show you the way, but not write the code for you.)
|
|
|
|
|
thanks for your reply Steve , i'll learn to fish
openup your heart and let the sun shine in
|
|
|
|
|
Pretty simple if you are programming with sockets.
If TCP, then you can refer to the IPEndPoint object after establising a connection OR accepting one.
If UDP, each message is self identifying so you can extract the Host IP from the header.
If you problem is not covered by Socket Programming, then let me know. Also there are about a zillion examples of TCP and UDP client between this site and if u google the net.
Good luck
Mike Luster
CTI/IVR/Telephony SME
|
|
|
|
|
thanks for your reply Mike,
i found this code
String strHostName = Dns.GetHostName();
// Find host by name
IPHostEntry iphostentry = Dns.GetHostByName(strHostName);
// Grab the first IP addresses
String IPStr = "";
foreach(IPAddress ipaddress in iphostentry.AddressList)
{
IPStr = ipaddress.ToString();
}
i am trying to do a chat program(socket programming it is my homework client send message to another client through the server) my time is over tomorrow ,unfortunately i couldnt fnish but i liked very much socket programming and i will search about, is there any article about socket programming you advise
openup your heart and let the sun shine in
|
|
|
|
|
If you are referring to the local PC as host you could use WMI to retrieve the IP address.
<br />
using System.Management<br />
<br />
public ArrayList ActiveIP()<br />
{<br />
ObjectQuery oq = new ObjectQuery("Select * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled=true");<br />
ManagementObjectSearcher mos = new ManagementObjectSearcher(oq);<br />
ArrayList NA = new ArrayList();<br />
<br />
foreach(ManagementObject moInfo in mos.Get())<br />
{<br />
string[] IP = (string[])moInfo["IPAddress"];<br />
NA.Add(IP.GetValue(0).ToString());<br />
}<br />
<br />
return NA;<br />
}<br />
This will return all the IP address the PC has.
Hope this helps!
I reject your reality and substitute my own!
- Adam Savage, Mythbuster
-George W Bush
life is like a roll of toilet paper. The closer it gets to the end, the faster it goes.
My definition of an expert in any field is a person who knows enough about what's really going on to be scared.
- PJ Plauger
|
|
|
|
|
thanks for your reply jklucker
openup your heart and let the sun shine in
|
|
|
|
|
thanks jklucker i have resolved the problem
openup your heart and let the sun shine in
|
|
|
|
|
I have an asp page where I load image in the webpage by browsing at run time. But there is a problem. I can load from any location from the computer instead i cannot load from the location desktop. If I choose the image from the destop it gives invalid parameter error. The following is the code:
string img = Upload.PostedFile.FileName.ToString();
lblimg.Text = img;
bmp = new Bitmap(img);
Deepak Anish
Computer Programmer
Maxumise Fiji Ltd
Suva, Fiji
|
|
|
|
|
That is because you are loading the physical file instead of using the data that was uploaded. The user account that is used to run the ASP.NET code does not have access to your personal folders, so it can't access the file on your desktop.
Also, accessing the file directly of course only works in the special case when you are browsing to the page from the same computer that is acting as web server.
---
b { font-weight: normal; }
|
|
|
|
|
But the same problem occurs when i try it from different computer.
Deepak Anish
Computer Programmer
Maxumise Fiji Ltd
Suva, Fiji
|
|
|
|
|
Check your file paths etc as has already been suggested.
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
(Translation: I'll show you the way, but not write the code for you.)
|
|
|
|