|
It happens every time I load the application. I have 4 different apps that I load on that machine and they all take a very long time to load compared to my development box. The server is a 2.4 GHz dual xeon processor machine running Windows Server 2003, which comes with .NET preinstalled. My dev box is a 2.4 GHz single processor laptop.
I thought perhaps it was because I did not change tempuri.org in the XML file that the app has to load, because the server does not have access to the internet. However, if I delete the tempuri.ord entry I the app still loads slow.
Robert
|
|
|
|
|
Hi!
I have a problem with a project I am currently working on:
I have to modify existing .xls-Files from my c# application, especially the link-paths of cells containing external content (mostly other .xls-files).
I have found several tutorials, etc how to read data from excel, but none how to write data or even links.
Greetings,
Matthias
|
|
|
|
|
Hello everybody,
I am writing an application that due with time. I use the DateTimePicker to get the time from user and store it in a smalldatetime-data-type column in the database. Then, I want to display the time user entered in a DataGrid, but only date is displayed.
For example:
In the database, column 'Time' stores:
01/11/2005 06:25:14
01/10/2005 07:17:24
01/09/2005 08:05:32
And the DataGrid displays:
01/11/2005
01/10/2005
01/09/2005
How can I solve this problem?
|
|
|
|
|
You will have to define the table and column styles for the grid (if not already done). The style class DataGridTextBoxColumn has a Format property where you can set the desired output.
|
|
|
|
|
Thank you for your helping!!!
|
|
|
|
|
Hello,
I have a question regarding a listBox. I am pulling data from a database and displaying the description in the listBox (using is as a search box). I want to be able to double click the description and pass that descriptions unique ID to a new method. Now I can pass the index of the description within the listBox but obviously this is not the same as the data’s unique ID within the database.
The only idea that I have come up with in do a count first, create an array to the size of the count and map the unique ID with the listBox index. This to me seems a very long winded way of going about this.
If anyone has any words of wisdom I will be very grateful.
Thanks.
Harold Clements
|
|
|
|
|
Create a small class or struct which has two properties Description and UniqueId. Override its ToString function so that it return Description. Now you can add instances of this class to the listbox. Now when an item is double clicked just cast the selected item to your newly create class type and get the unique id from the property.
|
|
|
|
|
Hi,
I am creating a generic data access module for an application and I have come across the following problem:
A form calls the function that loads data from a table to a grid. Then the code below is called in order to effect any changes in the dataset. The problem appears with a table that has 43 columns. When in the selectCommand I pass a select statement containing up to 32 columns it works without problems. When I increase the number of columns it gives a "Concurrency violation: the UpdateCommand affected 0 records." exception. Is this some because of some limitation or am I making an error in the code?
The table contains 4555 records
public void SaveDataFromGrid(DataSet dsName, string dtName, string selectCommand)
{
//DGM 20040109
//This code works only for single table updates.
//Create new Connection
OdbcConnection dbConnection = new OdbcConnection(strConnectionString);
//Set the sql command that will fill the dataset
OdbcCommand sqlCommand = new OdbcCommand(selectCommand, dbConnection);
sqlCommand.CommandTimeout = 30;
//Set the sql command that will update the dataset
//Set the data adapter
OdbcDataAdapter dbDataAdapter = new OdbcDataAdapter();
OdbcCommandBuilder cb = new OdbcCommandBuilder(dbDataAdapter);
dbDataAdapter.SelectCommand = sqlCommand;
//Open the connection
dbConnection.Open();
//Fill the dataset with the data
dbDataAdapter.Update(dsName, dtName);
//Close the database connection
dbConnection.Close();
//return true;
}
Thanks in advance for the help
|
|
|
|
|
HI,
is it possible to open words and read it inside my application rather then to read it by double clicking it in windows explorer...
thanks
Josh
|
|
|
|
|
I have some problems when i add some descriptions in a (.wmv) video with Windows Media Encoder SDK.
I got no error, warning or exception. However, no response after execution.
Please help.
Here is part of my code:
using WMEncoderLib;
try
{
Encoder = new WMEncoder();
IWMEncDisplayInfo Descr = Encoder.DisplayInfo;
Descr.Title = "Title";
Descr.Author = "Rock";
WMEncoder Encoder = new WMEncoder();
IWMEncFile2 File = (IWMEncFile2)Encoder.File;
File.LocalFileName = "C:\\OutputFile.wmv";
}
catch (Exception e)
{
}
|
|
|
|
|
hi everybody ........
i'm trying to do connect between 2 computers through the PSTN and send files bet. them, here is the required procedure:
1.comp1 calls(by user) comp2(which is waiting for call all the time).
2.when comp2 recieves the call, it sends(auto) a file to comp1
3.when the file is recieved the call should be ended(auto).
so can any one help,because i dont know how to start.
Is there any api's for hyperterminal that i can use, or can i configure hyperterminal to do such sequence,or ?????
please if anyone know anything that would help, please help me as soon as possible.
thanx.
|
|
|
|
|
Guys,
After compiling successfully my c# program I saw this message from the output box
------ Build started: Project: DTR, Configuration: Debug .NET ------
Preparing resources...
Updating references...
The dependency 'Interop.Microsoft.Office.Core' could not be found.
The dependency 'Interop.Microsoft.Office.Core' could not be found.
Performing main compilation...
Build complete -- 0 errors, 0 warnings
Building satellite assemblies...
---------------------- Done ----------------------
Build: 1 succeeded, 0 failed, 0 skipped"
at the same time I had an abnormal dlow in my program. When I display a certain in a program with the correspong criteria it didn't display the information only the page layout.
/dabuskol
|
|
|
|
|
How can I create an XML file from a Dataset by using the XMLDataDocument class. Can I also verify this file with an XSD before writing.
|
|
|
|
|
hi,
in .net after setting an object refrence to null garbage collector collects the object and frees the resources used for that object.i want to know if there is way to free resources without using GC?
|
|
|
|
|
|
hi all there, i want a code that help me to insert any file type in a rtf file, i need to insert by code not drag drop by mouse so plzzzzzzzzzzzzz help me .......
Thanks alot
Metal Man
|
|
|
|
|
My application logs its operation into a file.
As part of the application when an exception is thrown I am logging the exception.
The log shows the whole exception stacktrace and message in English and it’s fine.
However, when the application is installed on Russian Windows the exception messages (not the stacktrace) is logged in Russian.
How can I cause the exception to be written always in English?
I know that when I change the Thread.CurrentThread.CurrentUICulture to of the thread to CultureInfo.InvariantCulture just before the exception is thrown then the exception message is in English even on the Russian machine.
This solution forces me to change the CultureUI of the all the threads on creation and it’s not nice solution.
Ami
|
|
|
|
|
Hi,
I have a C# App that uses a Crystal Report. Each company that uses the software has its own logo image which i need to be able to pass and display on the report. I have been able to do this by storing the .BMP in the database but do not like this approach as it uses up too much database space (I am using MS Access as the database).
So what i am looking for is a way to load the image in the report from a specified directory path...or any other method to achieve the same goal. Any help will be much appreciated.
I have been racking my brain for days now and I know that if anyone can help, they are most certainly in this forum.
Cheers
Craig
|
|
|
|
|
I am programming in C#.
I want to stream a video via TCP/IP.
can i just use NetworkStream class and use the Read and Write method to do so?
Pls. help
|
|
|
|
|
It's not the most efficient, but yes you can.
You should study streaming media by googling the 'net. We've also discussed it in this forum before. To find older threads, click "Search comments" at the top of this message board and search for "streaming".
More advanced algorithms are tolerant to a certain amount of data loss, sending encoded packets instead of reading the entire stream as an encoded file. There's much more involved for an efficient algorithm as well.
My recommendation is to use what's already available. Windows Media Encoder is free from microsoft.com and you can easily stream it to your client application using the Managed DirectX[^] assemblies, which utilize the compliant codecs (encoders and decoders) found on the system like WMA, WMV, DivX, MP3, MPEG, etc.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
I am drawing lines of different colors based on a criteria. I have an If Else loop and when the panel paint event is called it selects the color specified in the else statement by default. Kinda overrides the color in the if statement. So all the lines turn out be blue. Here is the code:
foreach(Line l in Lines)
{
if(locallink!=null)
{
char charfileindex1='#';
int charfileindexlen1=locallink.Split(charfileindex1).Length;
string[] ss=new string[charfileindexlen1];
ss=locallink.Split(charfileindex1);
for(int i=0; i {
//int index=ss[i].IndexOf(dragimage);
if(checklinks(ss[i].ToString())> 0)
{
//draws red line
DrawAssocLine(l);
label4.Text="Red"+k.ToString();
k++;
}
else
{
//draws blue line
DrawLine(l);
label5.Text="Blue"+m.ToString();
m++;
}
}
}
}
Region r = getRegionByLine(line,p);
thumbnailpanel.Invalidate(r);
thumbnailpanel.Update();
r.Dispose();
|
|
|
|
|
if and else do not describe a loop; they are conditional statements.
What exactly is your problem? What is your question? I don't see where you've drawing with different Pen s and you didn't state what your problem was - only that you were having a problem.
If you need to draw with different Pen s, the best solution is to - if possible - instantiate those Pen s once and re-use them. If the code above is for your OnPaint override I can already tell your component will update slowly. Only paint what you have to, and try to avoid costing operations - like instantiating new objects - in your paint handlers. Cache what you can.
And always call base.OnPaint as the first operation in your handler (or around there - before you start painting). If you don't, part of the control may not be drawn (depending on what it is) and the Paint event will not be fired (so Paint event handlers will not be called).
If you are doing this in a Paint event handler, then consider extending whatever class you're painting now and overriding OnPaint . This gives you greater flexibility and is faster than invoking an event handler (or chain of event handlers).
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
So what is your question? I would guess you dont want that all lines are painted in blue. But there is nothing such as a override from the else over the if block. To find your error the provided code is not enough. First of all check if your condidition ever gets true. Secondly check if your DrawLine and DrawAssocLine really paint lines in different colors. And third make sure that no two lines are exactly above each other (that could lead to a blue line overpainting a red line).
|
|
|
|
|
I have several windows openned of the same form class;
upon closing out the last mainform, I hid it, so the app doesn't exit;
thereafter, I create a new form; I repeat the
closing and opening of this
new form (the mainform is still hidden);
I have noticed that mem usage keeps going up?
Any help on what's going on? Corrections?
Should I try to Dispose/Release the hHWD's manually?
"Being smart is no good until you find out who else is smarter?"
|
|
|
|
|
It's not a memory leak it's just that the GC hasn't reclaimed the memory the form that gone out of scope.
Here's a test you can do... Instantiate and destroy the offending form about 10x's, then call GC.Collect() and see what happens.
|
|
|
|