|
Try calling SuspendLayout() showing the controls then calling ResumeLayout().
|
|
|
|
|
I hope I can explain the problem clear enough. I am loading data from my database into a DataSet and then display the data in a ListView. The user can then select one or more of the records in the ListView for deletion and the click the Delete button. After the Update method of the DataAdapter was called, I would like the records that were successfully deleted, to be removed from the ListView, but the records that could not be deleted (for whatever reason: Concurrence problems, has child records, etc) to be highlighted in the ListView. The user can then click on a Report button to see what the reason was for each of the delete errors.
Is this possible? How can this be achieved? I am using Visual Studio 2003 and C#.
Thanks.
Kobus
|
|
|
|
|
First you have to save the records to be deleted for later highlighting them. Save them to a dataset or whatever you find yourself comfortable with.
Then when deleting the rows use try catch error handling. I hope you know how to use try catch stuff. Whatever. Then in the catch part if there are any errors you can your saved datas there and highlight the previously them.
|
|
|
|
|
Hi
I am getting the problem in changing the Default Back Color of the Column header and the Row Header of the DataGridView Control in Visual Studio 2005 C# Dot Net.
Can you please give the solution or the way around.
Ajay Kumar
hy
|
|
|
|
|
There are some properties which end with the word "Style" check those out, their essentially containers for the different themes.
As of how to accomplish that have you ever tried Google?
Failing that try .
|
|
|
|
|
I'd like to have Speech to text (Speech Recognition) documentation.
Thank you so much
|
|
|
|
|
For which product?
As of how to accomplish that have you ever tried Google?
Failing that try .
|
|
|
|
|
Hi
How i can get some information from file which is separeted by semicore.
For example.
name;age;sex;
i need to put all this into array how to do it?
when i want to read something good just seat and type it
|
|
|
|
|
string text = File.ReadAllText();
string[] array = text .Split(';');
can't get easier than this.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
read all the data from the file and store it in a string. then use the string.split() method of c# to split the array. this will return you array having all the records in it without semicore.
the syntax is
string selectedNode; // to store data from file
char[] splitter = { ';' }; // splitter to be used
string[] machineNode; // array which will contain the data after splitting the //string
machineNode = selectedNode.Split();
now u can use machineNode as any array to retrieve data.
regards
sAqIb
|
|
|
|
|
Hope this helps
Regards
private void _parse(string sourceFile)
{
string[] tokens;
// Check if source file exists
if (File.Exists(sourceFile) == false)
throw new Exception("Source file does not exist");
TextReader TR = File.OpenText(sourceFile);
// Parse file
for (string currentLine = TR.ReadLine(); currentLine != null; currentLine = TR.ReadLine())
{
tokens = currentLine.Split(";".ToCharArray());
}
TR.Close();
}
|
|
|
|
|
Thank's too all of you
when i want to read something good just seat and type it
|
|
|
|
|
I have written a service in C# which does some database stuff. At certain intervals it checks if the Database is still reachable by simply Opening and closing the ODBCConnection object.
It seems however that whenever I open and close the connection the memory used by the process increases (noticed this with windows task manager). This is very unwanted offcourse, since the service I make should run for very long periods of time. I tried creating the ODBCConnection object in a using block, but still the effect is the same. Is this indeed a problem in .NET currently? Am I forgetting a certain action that would dump this memory?
Yesterday I ran this app whole night long, just opening and closing the connection object and this morning I noticed that almost all memory was being used, so I figure that it`s not something that the CLR will clean up.
Please if anybody knows about this problem and any solution give me an answer..
Thanks,
Davy
|
|
|
|
|
Maybe you have to Dispose the object manually... when you don't need your object anymore, try calling the Dispose method or set it to null.
hope this helps.
|
|
|
|
|
Hi
I would like to know how I would go about doing a document counter.
This counter should count how many times a document within a page has been downloaded or has been viwed.
Any help would be greatly appreciated.
C# and SQL
|
|
|
|
|
Hi!
Does anyone know, where i can specify a channel of my sound card to
play a mci-video?
I created a class Media, where i have 2 functions that are neccessary
for playing the movie:
1.) public void Open(string sFileName,System.Windows.Forms.PictureBox
videobox)
{
if(this.Status() == "playing")
this.Close();
sCommand = "open \"" + sFileName + "\" type mpegvideo alias
MediaFile style child parent " + videobox.Handle.ToInt32();
mciSendString(sCommand, null, 0, IntPtr.Zero);
sCommand = "put MediaFile window at 0 0 " + videobox.Width + " "
+videobox.Height;
mciSendString(sCommand, null, 0, IntPtr.Zero);
FileIsOpen = true;
}
2.)
public void Play()
{
if(FileIsOpen)
{
sCommand = "play MediaFile";
if (Repeat)
sCommand += " REPEAT";
mciSendString(sCommand, null, 0, IntPtr.Zero);
timer1.Enabled = true;
}
}
But where can i specify the channel for audio output????
As i said i have a sound card with 4 channels, additionally i have the
on board sound.
I want to play the sound on every channel - but how can i do this???
|
|
|
|
|
I have made a windows service.And write a low level keyboard event in it. But it did not invoke when any key pressed.
May any one tell me How events would be invoke in Windows Service.
|
|
|
|
|
What do you mean by "a low level keyboard event"? Did you write a keyboard hook? What does the code look like? Also, Services run under their own desktop. If all you did was create a form and handle its KeyDown event, it'll never see a single keystroke.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi,
Is it possible to use DAO (Data Access Objects) with C# code?
I need to edit a Jet database... and DDL SQL is not cutting it.
I've searched the net, and can't find DAO code samples in C#.
Is DAO a dead dog? If so, I can't find much on ADOX for C# either.
thanks,
Ron
|
|
|
|
|
C# supports ADO.Net for any kind of databases. so you can use ADO.Net to access your database.
|
|
|
|
|
Unfortunately, from my research, ADO.NET SQL isn't able to change the column's "Allow Zero Length" property. That is why I'm turning to DAO or ADOX.
Ron
|
|
|
|
|
DAO died a long time ago. Also, the last version of DAO won't work with Access XP and above databases.
You can find the ADOX docs here[^]. There are no C# examples, so you'll be translating the VB6 examples.
Just make sure you have the latest MDAC installed. You'll be adding a COM reference to ADOX. You won't find this stuff in a .NET library anywhere.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thanks for the info and link Dave!
Half the battle is finding the right direction to follow.
Ron
|
|
|
|
|
Hi
I want to read/write file located in the C:\Windows directory of remote pc. Can anyone suggest me wat are the possible ways and which is the best way to do that.
Regards
sAqIb
|
|
|
|
|
Well if you are looking for a C# solution then you will need a program running on that remote PC that will be able to accept commands(and then operate with that file) over the internet from your PC. Look at remoting (this site has plenty of articles) for ideas how to acomplish that.
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|