|
Call this Function in the TextChanged Event before validating the data
private void EndEditOperation()
{
if (this.currentGridRow >= 0)
{
CurrencyManager currencyManager = (CurrencyManager) this.dataGridAllocation.BindingContext[this.dataTable];
if (currencyManager != null)
{
currencyManager.Position = this.currentGridRow;
DataGridColumnStyle dataGridColumnStyle = this.dataGridAllocation.TableStyles[0].GridColumnStyles[0];
this.dataGridAllocation.EndEdit(dataGridColumnStyle, this.currentGridRow, false);
}
}
}
Live Life King Size
Alomgir Miah
|
|
|
|
|
is there any control in .NET like image list but it can store files from any type, not only image format ?
thx all
|
|
|
|
|
I don't know of one. It wouldn't be hard to write on though.
|
|
|
|
|
It's called a Resource File. For text/html/xml you can populate it within visual studio. For binary it is a bit harder. I think I ran a utility that allowed me to create the binary resource file.
We used this approach to hold our class code for objects we wanted to slip in front of. Basically we wrote a 'Cookoos Egg' compiler, grabbed assemblies out of memory at startup, inserted the code out of the resource file for that class, then recompiled the assembly and stuck it back into memory.
There are 10 kinds of people in the world.
Those that read binary...
...and those who don't.
|
|
|
|
|
I have to diplay a RadioButtonList with the selection according to the data I retrieved from a table. The Radio Button list has two selection: M & F. Depending on the value Male or Female I get from the table, it will display M or F selection as true. How would I do switch the selection back and forth on the code behind in C#? Any help would be appreciated.
|
|
|
|
|
this.radioButton2.CheckedChanged += new System.EventHandler(this.radioButton2_CheckedChanged);
private void radioButton2_CheckedChanged(object sender, System.EventArgs e)
{
//Do your Stuff
}
Live Life King Size
Alomgir Miah
|
|
|
|
|
Does anyone has a working example of XMLSQLBulkLoad from C#?
I have a dataset in C# which I am converting into XML and XSD as below
m_dsExcel.WriteXml(path+ "\\RuchiT.xml");<br />
m_dsExcel.WriteXmlSchema(path+ "\\RuchiS.xml");
Then I am making connection to SQL server as below, but nothing seems to be inserted in SQL table
SQLXMLBulkLoad3Class bulkLoad = new SQLXMLBulkLoad3Class();<br />
bulkLoad.ConnectionString = "PROVIDER=sqloledb;SERVER=servername;database=dbName;INTEGRATED SECURITY=sspi;";<br />
;<br />
<br />
bulkLoad.Transaction = false;<br />
bulkLoad.BulkLoad = true;<br />
bulkLoad.SchemaGen = true;<br />
bulkLoad.KeepIdentity = true;<br />
<br />
bulkLoad.Execute(RuchiS.xml, RuchiT.xml);
Any clues???? Appreciate you help.
Thanks
Ruchi
|
|
|
|
|
Don't know quite how to word this question, thus I have not search for it, but is there a way to eliminate all the HTML from the code of an ASPX page? Meaning, if I did Response.Write("blah")
and did View Code, all I would see would be blah?
The reason I ask is that I need to call an aspx page from Flash and get the data returned, but it must be in the form blah=what&count=1 etc... Unless there is a better way. Any suggestions?
|
|
|
|
|
just call in the Page_Load event handler Response.Clear(), then write all you want.
|
|
|
|
|
Hi all,
I am new to this forum. We are developing a project to upload media files (wma and wmv). For that we need to validate the files. The thing I am not getting is: Is there any ways to check (retrieve) the Bit Rates of a specified file. Help is very much appreciated.
Regards,
Jagannathan Sridharan
|
|
|
|
|
I believe that in all wm* files there is at least an 'average bitrate' tag inside the file: try to open one of them with a hex editor and you'll locate it. the problem is that the tag is not written in plain text, but in a unknown (at least to me!!!) binary format, such as 'avgbitrateSOMEINVISIBLECHARS'.
|
|
|
|
|
Thanks darisole,
My scenario is this: The user can select a media file (from remote machine). I should get that file, but before uploading it to the server I need to check the Bit Rates(average bit rate). Programmatically, I should do everything. For that, Do I need to use some SDKs? Like, Windows media Player SDK etc.,
Thanks very much once again,
Jagannathan Sridharan.
|
|
|
|
|
I'm afraid I don't know if in the Windows Media SDK there are some APIs to do read the bitrate from wm files.
this is what I found with an hex editor in a VBR wma file:
................
V.B.R...........
................
you can see that it is almost impossbile to understand the formats.
I believe in the WM SDK there is a win32 api that does the work, but if it is so, you have to wrap it in a .NET class library. it may be very difficult, especially if there isn't much documentation about it.
|
|
|
|
|
I have to scratch my head with WM SDK I guess. Neways thanks darisole.
|
|
|
|
|
Hello,
I'm Ashwini currently pursuing my B.Tech. We have an RDBMS project this semester. We(a group of 4 members) have decided to use C#.Net as the front-end. Can u please give us some help regarding this as soon as possible.
Ashwini
|
|
|
|
|
Help with what? You need to ask a more specific question.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi for all
I don't understand what's going on. I have a client-server app with 2 threads. They do the same work, that is: the current thread calls a thread to execute a draw method on my form. In first time the method works good(both of them). But in the second nothing is drawed. I put my code now:
//the threaded method
public void Running()
{
try
{
while(true)
{
Connexion = ServerListener.AcceptSocket();
if(Connexion.Connected)
{
DataStream = new NetworkStream(Connexion);
Reader = new BinaryReader(DataStream);
Writer = new BinaryWriter(DataStream);
m_bConnect = true;
do
{
sData = Reader.ReadString();
using(Draw Desenho = new Draw())
{
//the called method
Desenho.GetCoordinates(sData+Form1.stCoordinates, G, true);
}
}while(DataStream != null && sData != "Close connection");
}
}
Reader.Close();
Writer.Close();
DataStream.Close();
Connexion.Close();
Application.Exit();
}
Notice that I pass a Graphics parameter, that is a private Graphics variable of my class. When I close my applications the following error appears:
"An undhandled exception of type 'System.Runtime.InteropServices.ExternalException' occurried in System.Drawing.dll
Additional information: A generic error ocurried in GDI+."
What is going on?
Thanks a lot!
C#er
|
|
|
|
|
Dont close the DataStream. It sucks I know. I had a similar situation,
Check this
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemDrawingBitmapClassctorTopic6.asp
You must keep the stream open for the lifetime of the Bitmap object.
The situation is similar.
Live Life King Size
Alomgir Miah
|
|
|
|
|
Man, I commented out the "DataStream.Close()" and the problem persists.
I've no idea what this problem occurs.
Can you help me again Alomgir Miah? Thanks a lot!
|
|
|
|
|
I know one thing for sure, this problem is caused by streams. Please comment out all the close statements and test by uncommenting them one by one. ( I know its a layman solution). Still give it a shot.
One more thing - are you using streams elsewhere.
If you see the debug trace and call stack, you will realize that the exception occurs in the Paint event handler. Follow the details of the exception you get, you will get that answer. In the onpaint method, the GDI is accessing some null values (which you will have to find).
If nothing works, worst case scenario, the quickfix is override the OnPaint event handler and catch the exception but dont handle it.
protected override void OnPaint(PaintEventArgs e)
{
try
{
base.OnPaint (e);
}
catch
{
//Do Nothing
}
}
Live Life King Size
Alomgir Miah
|
|
|
|
|
Man, I think that you'll scold me a lot. The problem was I'm not breaking a "while" statement. Sorry, sorry, sorry. Thanks for help one more time and for the tips.
|
|
|
|
|
Never mind.
Live Life King Size
Alomgir Miah
|
|
|
|
|
I read a bitmap from file with the following code:
Bitmap tempBitmap = new Bitmap(bitmapFileName);
Later I want to save an updated version of the bitmap with this code:
if (System.IO.File.Exists(bitmapFileName)
System.IO.File.Delete(bitmapFileName);
tempBitmap.Save(bitmapFileName);
Unfortunately, when it gets to the delete, I get the following error:
"System.IO.IOException: The process cannot access the file "filename.bmp" because it is being used by another process."
The creation of the bitmap from file is holding on to the connection. I tried cloning and copying to the clipboard, but the only way I have been able to get this to work is by copying all my bitmaps to temp files and opening from the temp file. Then the file I delete and save to is a different file. I am hoping there is a better way.
|
|
|
|
|
The Bitmap object holds the file open for the lifetime of the object. The trick is to read the file yourself, create the bitmap from that stream, then close the stream.
FileStream fs = new FileStream(@"C:\bitmap.bmp");
Bitmap b = new Bitmap(fs);
fs.Close();
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
From MSDN,
You must keep the stream open for the lifetime of the Bitmap object.
Live Life King Size
Alomgir Miah
|
|
|
|