|
Is the DataView bound to the dataset? In that case, updates on the data set will cause the dataview to update as well, and those updates will occur on the background worker thread, instead of the UI thread.
Did you try unbinding the dataview, merging it in the background, and then binding it again?
|
|
|
|
|
Hi Senthil
my dataGridvIew bound to bindingSource in designer code, however i set dataGridView.DataSource property to bindingSource but it still did not display data.
|
|
|
|
|
Hi, I developed an Client / Server application, the problem is the following:
- when a wrong IP address is inserted in the Textbox, Client application freeze.
TcpClient socketForServer;
try
{
socketForServer = new TcpClient(Ip, Port);
}
catch (Exception e1) {
info._error = e1.ToString();
return info;
}
What I can do?
|
|
|
|
|
You will want to start running your TCPClient on a different Thread so it doesn't lock up the GUI thread while waiting for a timeout or connection refused.
So do the following
ThreadPool.QueueUserWorkItem(new WaitCallback(<function that="" starts="" the="" tcpclient="" connection="">));
Keep in mind that the Drawing of items can only be done on the thread they were created on (usually the main thread) so setting text and that sort of thing should be done by invoking the functions using the Invoke function
|
|
|
|
|
Alternatively you can also use the asynchronous methods of TCP client to make your connection, BeginConnect and EndConnect
|
|
|
|
|
|
there are couple of things that you may do
1. Application.DoEvents()
2. You need to set socketForServer to null in case an error occurs, it will be creating a new object every time and will become a source of memory leak.
Ahsan Ullah
Senior Software Engineer
MCTS 2.0
|
|
|
|
|
I have loaded 6 columns to a DataSet using a DataAdapter. Now I want to change the first column's items to a frequent series of numbers.I have tried the code below ,but it didn't affect the data:
for(int i=0 ; i
|
|
|
|
|
saeidfarahi wrote: myDataSet.Tables[0].Rows[i].itemArray[0] = i + 1;
DataSet.Table is read-only, therefore cannot be edited.
Have you thought about putting the DataAdapter into a DataTable instead, then edit the DataTable, then adding it to a DataSet if necessary.
My failometer is detecting vast quantities of FAIL!
"Its SQL - hardly programming..." (Caslen)
|
|
|
|
|
You need to get a datatable from database and do something like this.
DataTable dataTable = new DataTable ( dataTableObject.TableName );
DataColumn dataColumn = new DataColumn ( columnName, Type.GetType ( "System.Int32" ) );
dataColumn.AutoIncrement = true;
dataColumn.AutoIncrementSeed = dataColumn.AutoIncrementStep = 1;
dataTable.Columns.Add ( dataColumn );
DataTableReader dataTableReader = new DataTableReader ( dataTableObject );
dataTable.Load ( dataTableReader );
DataSet dataSet = new DataSet ();
dataSet.Tables.Add ( dataTable );
Ahsan Ullah
Senior Software Engineer
MCTS 2.0
|
|
|
|
|
hello,
i am using the following code:
WebBrowser Web = new WebBrowser();
Web.Navigate("http://...", "_blank");
.
does anyone know if it is memory consuming?
and if i dont have internet explorer as a default browser will it work?
for example with firefox.
tnx ,
avi
|
|
|
|
|
shabya wrote: does anyone know if it is memory consuming?
Yes, very. It says so in the documentation[^], 'The WebBrowser control is resource-intensive. Be sure to call the Dispose() method when you are finished using the control to ensure that all resources are released in a timely fashion. You must call the Dispose() method on the same thread that attached the events, which should always be the message or user-interface (UI) thread.'
shabya wrote: if i dont have internet explorer as a default browser will it work?
Yes
My failometer is detecting vast quantities of FAIL!
"Its SQL - hardly programming..." (Caslen)
|
|
|
|
|
though it is memory consuming but you can use it normal circumstances easily. If you have a very resource hungry application then you should avoid using it. You can use it irrelevant of what your default browser is.
Ahsan Ullah
Senior Software Engineer
MCTS 2.0
|
|
|
|
|
shabya wrote: and if i dont have internet explorer as a default browser will it work?
for example with firefox.
It still uses Internet Explorer to render the page, regardless of your default browser.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
about the browser being opened -
what if explorer is removed ? (if it is possible i dont know)
i went to the WebBrowser thing because i couldn't open the desired URL in a new window. what happened was it ran over an existing page...
the code that i used:
System.Diagnostics.Process.Start("http://www...");
.
using iexplore /new and stuff doesnt work here
tnx
|
|
|
|
|
You might be able to remove the Internet Explorer application, but the rendering engine that the control uses is still there.
If the browser opens a new window or reuses windows is a choise in the browser settings. In Internet Explorer it's under advanced options and is called "Reuse windows for launching shortcuts".
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
tnx , but i cant ask my customers to do that , they are usually art and nature like activists...
|
|
|
|
|
Hi
I'm writing a db app with the following features :
1. have a list of items (FormReportItems)
2. for new Item and edit Item, the new form open (FormItem)
3. the new item or current item pass to FormItem constructor and return that specific item to update data in form list (FormReportItems), some thing like this :
AppDataSet.SampleTableRow itemNewRow = this.appDataSet.SampleTable.SampleTableRow();
FrmSampleTable frm = new FrmSampleTable(itemNewRow, this.appDataSet);
if (frm.ShowDialog() == DialogResult.OK)
{
this.appDataSet.SampleTable.AddSampleTableRow(itemNewRow);
DataManager dm = new DataManager();
dm.SampleTableWithImages(this.appDataSet);
}
it work correctly while working in relational data.
each item can some images in Images table, hence i must update data with images. my problem is to pass images table to FormItem and get result back to current form (FormReportItems) then update data. for this i've passed current dataSet to FrmSampleTable constructor as second parameter to hold inserted or edited images in FormSampleTable (FormItem), when FormSampleTable returns DialogResult.OK the dataBase must be update to commit changes.
my problem is when i want to pass images dataTable to current dataSet, it does not have any records, wheras in FormSampleTable it have some records.
can anybody help me about this issue ?
what's your idea in Insert & Edit relational data Form ?
thanks
|
|
|
|
|
If I understand your question correctly, I believe what you are trying to accomplish is something like:
-Pull data down from the database
-Make local changes to the data
-Update again from the database***
-Push your changes up to the server
And the problem you are having is merging the datasets together.
If this is what you are trying to do there are two routes of action I would consider:
1- is there any way around this, so you could avoid the problem completely? I suggest you take a step back, look through your code, and see if there is a different design strategy you could follow. If you could somehow remove the step where you update from that database again, the problem would probably be straight forward.
2- if you really do need to do something like this, I suggest checking out the Microsoft Sync Framework. It is designed to sync between multiple data connections, and in addition to making the updating easy, if conflicts happen it will detect those too. Take Data Offline Using Microsoft Synchronization Services for ADO.NET[^] that is a link that looks like a pretty good introduction to Harmonica. I honestly haven't read the entire article, but it looks like a good starting ground.
Let me know if I misunderstood your question.
-Ken
|
|
|
|
|
Dear All,
Iam implementing a project through which i want to convert the entered text through UI into desired Handwriting Pattern
iam using Tablet Pc Pen As an input device to capture my handwriting (iam using Microsoft.ink as namspace )what i have done till now is that , after using ink pen of tablet pc , i have written something on the Ink control of .net and store the image as GIF format
now i want my PC to learn my handwriting pattern , tell me how i can acieve using .net(csharp/vb.net) ,so that when i enter any text through UI it can convert it into my handwiriting sample
please also tell me how i will capture the Information , about the Pressure, strokes, trasparency etc of the pen tip
I need your help
please suggest some sample code for me
|
|
|
|
|
Hi,
The idea you have is pretty cool, however it would be a lot of work if you want to do it correctly. The problem with handwriting is that no 2 characters are usually the same, it usually depends on the letter before, the position in the line you are trying to write the length of the word you write (long words require you to move your hand while writing causing the letters to be written differently), the speed at which you are writing (scratching something down or writing a proper letter), the texture of the paper and finally the type of pen used. Although the ligature functions on the opentype font specification would allow you to do some of these things, it would be a heck of a lot of work.
The easy way out is to just create a Bitmap font[^] of your handwriting, the result would not be stunning but its the easiest way to go if you don't want to spend a lot of time on it
|
|
|
|
|
Yeah, what he said. Take a look at this[^].
|
|
|
|
|
I am not understand the session state or view state from ASP.net web form. please!
|
|
|
|
|
Possibly, posting this under the Asp.Net forum icght be a better idea than the C#?
Oh, you did allready.
Carpet bombing forums does not help - it just annoys people.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Ok, well first off, I just wanna let everyone know I have very little experience in C# so please be patient with me. (I'm working in Microsoft Visual C# 2008 btw) I have a fairly simple project I'm working on and I need a lot of help. I really hate asking people for help, but this is driving me crazy. Now to the project. Let's say I have a directory "C:/textures/" and inside are lots of pairs of files, a texture file, and a jpg of the texture. I'm trying to make a program that has a picture box with up and down arrow buttons that will cycle through all the pictures in that directory, and when a third button is pressed, it will copy the current picture's corresponding texture file to a very specific directory on an SD card and rename it based on the name (and overwrite any files of the same new name there). Here's an example of the files:
dogtexture.tex
dogtexture.jpg
cattexture.tex
cattexture.jpg
copy dogtexture.tex to SD/textures/dog/dog01.tex
or
copy cattexture.tex to SD/textures/cat/cat01.tex
Any help would be greatly appreciated
|
|
|
|