|
thanks it doesn't work.
I'll try dgv.autogeneratecolumns = false and so on.
|
|
|
|
|
I'm giving up, it's quite a nightmare if the system itself doesn't understand values it automatically wrote.
|
|
|
|
|
LordZoster wrote: it's quite a nightmare if the system itself doesn't understand values it automatically wrote
This is why I nearly always roll my own DAL and handle the databinding with custom business objects.
I never use the BindingSource stuff..
I don't speak Idiot - please talk slowly and clearly
'This space for rent'
Driven to the arms of Heineken by the wife
|
|
|
|
|
You mean, u need to convert it from string
MyDataTable.Rows[RowNum]["MyDateTimeField"]=Convert.ToDateTime(MyStringDate);
Are you talking about this?
|
|
|
|
|
The BindingSource is supposed to handle this conversion by itself, doesn't it?
And, in case I overrun this conversion writing my own one, where should I write it?
From what I understand (very little, I admit) I should overrun a whole lot of stuff of BindingSource: in this I totally agree with Andy_J, it is preferrable to use one's own DAL.
The worst thing is, that datetime cell is readonly, so there's no need to write it back into the database from the datagridview hence no need to convert any string...
|
|
|
|
|
Hi, Iam using C#2010. I have a problem with my SQL-Save {DataAdapter.Update(DataTable);}.
Actually I have created a datatable and Columns added properly. Then its getting save properly. No Problem.
But while I run a linq Query and created a DataTable, its not getting update. While I check the datatable its showing the same column name. But its not getting update. I can't understand the problem. Thanks for the Ideas.
var Results = from SelRow in MyDtb1.AsEnumerable() where SelRow.Field("door_no") != null select SelRow;
DataTable ChkResult = Results.CopyToDataTable();
ChkResult.AcceptChanges();
MySQLCon.Open();
SqlTransaction Trans1 = MySQLCon.BeginTransaction();
VeSavDAp.UpdateCommand.Transaction = Trans1;
VeSavDAp.InsertCommand.Transaction = Trans1;
myDataGrid1.CurrentCell = myDataGrid1.FirstDisplayedCell;
myDataGrid1.EndEdit();
VeSavDAp.AcceptChangesDuringUpdate = true;
VeSavDAp.Update(ChkResult);
Trans1.Commit();
MYSQLCon.Close();
Thanks For The Ideas.
|
|
|
|
|
Aaahh yuck I'm not going to enjoy this.
You are running into some of the issues of using the MS datatable and adaptors combined with inline editing in list controls. Take a look into Data Access Layer (DAL) there are meny fine articles explaining this. It will give you a much better understaning of what is happening to your data.
Currently you are relying on the MS black box stuff they supply in the adaptors with no real understanding of what is going on.
Inline editing in list controls is a personal phobia, I always pop a dialog or have a details panel for editing rather than try and force the Grid.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi
is there a way to initialize generics using something like this:
Type myT = typeof(string)
List<myT>myList = new List<myT>();
and not directly
List<string> myList = new List<string>
Thanks for your time
modified on Sunday, May 29, 2011 4:29 PM
|
|
|
|
|
Fix your post please...
I assume you mean
Type myT = typeof(double);
List<myT> myList = new List<myT>();
<Type> is evaluated at compile time, so using a runtime Type variable like that won't work.
For a possible solution, see C# specifying generic collection type param at runtime[^]
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
|
|
Hello everyone,
Gestures 14 + is my final year project on hand gesture recognition using computer vision.Gestures 14 + supports 14 types of hand gestures.It has also got a learning mode.
This project uses AForge.NET framework
I want to share this with u ppl
Here is the video demonstration of the project
http://www.youtube.com/watch?v=X2BW6HbwcGo
What you guys have to say about the project??
|
|
|
|
|
Nice video, but it would be more interesting if you wrote an article about it.
The best things in life are not things.
|
|
|
|
|
Thanks I will write an article then.
|
|
|
|
|
Hi Iam using C#2010. From my MdiParent toolstrip Iam using the following codes to open the mdichild
Public partial Class Form1 : Form
{
Form3 MyNewName=New Form3();
private void toolStripButton2_Click(object sender, EventArgs e)
{
MyNewName.MdiParent = this;
MyNewName.FormBorderStyle = FormBorderStyle.None;
MyNewName.Dock = DockStyle.Fill;
MyNewName.Show();
}
}
And For once the close button is clicked all of mdichildren use to close by its MDI_form closing event.
But the problem is I cannot reopen the form "Its saying caanot access a disposed object" And if I use
Form3 MyNewName=New Form3();
then the other subs are not running...
So how to keep the instances permanently even if the form is closed?
And Instead of Form hide any other better ideas?
Thanks & Regards PARAMU
|
|
|
|
|
From Reflector, the code for Form.Close is:
public void Close()
{
if (base.GetState(0x40000))
{
throw new InvalidOperationException(SR.GetString("ClosingWhileCreatingHandle", new object[] { "Close" }));
}
if (base.IsHandleCreated)
{
this.closeReason = CloseReason.UserClosing;
base.SendMessage(0x10, 0, 0);
}
else
{
base.Dispose();
}
}
So as you can see, if you close the form, it will be disposed. If you want to keep the same instance, hide it. Otherwise, check if your field is null, if so - recreate it; if not, show it.
|
|
|
|
|
Thanks Dave...I get clear.
Thanks and Regards
PARAMU
|
|
|
|
|
I have an app that replies to all AT commands except for ATD7059999999. When I go to HyperTerminal all commands including ATD7059999999 works. I even tried ATDT.
What can Hyperterminal be doing that I'm not?
|
|
|
|
|
As you are in Canada I believe you need to add the country code of 1 before the area code. Try ATDT1-705-999-9999. Hyperterminal automatically prefixes the code for you.
It’s not because things are difficult that we do not dare, it’s because we do not dare that things are difficult. ~Seneca
|
|
|
|
|
on top of what it may do to your phone number itself, HyperTerminal and your code could differ in a couple of ways:
1. the way you and they use the serial port's control lines;
2. the timing; you typing at HT sure works slower than your code possibly working at CPU speeds.
Luc Pattyn [My Articles] Nil Volentibus Arduum
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Please use <PRE> tags for code snippets, they improve readability. CP Vanity has been updated to V2.3
|
|
|
|
|
Circle gets a square!
It was all about timing.
Thank you!
|
|
|
|
|
Hi,
I need to do a Publish of my application (ClickOnce) so people can install my application from the web. With ClickOnce the setup.exe file is automatically created. What I have done in my application is to add a "Visual Studio Setup project" (which I named AppSetup) and there I have made an important Custom Action in the Install folder.
How can I make ClickOnce create the setup.exe based on AppSetup instead of creating a default setup.exe automatically? If this is not possible, how can I make Custom Actions on the setup.exe (that ClickOnce creates automatically) before I publish my application?
In short: is there a way to make the automatically created setup.exe (with ClickOnce) have a CustomActionData?
Thanks in advance.
modified on Monday, May 30, 2011 3:33 AM
|
|
|
|
|
Ok, no answer and I understand why: After doing more research I found out that ClickOnce doesn’t support custom action or something similar to let user take action when install/uninstall/etc happens.
|
|
|
|
|
hi
i have used Nokia 7610 as GSM modem. i use the following code to receive a call on computer but it did not work.
serialPort1.PortName = "COM4";
serialPort1.BaudRate = 115200;
serialPort1.DataBits = 8;
serialPort1.Parity = Parity.None;
serialPort1.StopBits = StopBits.One;
serialPort1.Open();
on button click i added the AT command to receive a call
serialPort1.Write("ATA");
but it did not work. please tell me what i m doing wrong
thanks
|
|
|
|