|
has autopost back property of this control is set true or not.
rahul
|
|
|
|
|
yes rahul it was not set to true..
thanks for the valuable suggestion.
now it is working fine..
pintoo
|
|
|
|
|
I am creating application on C#.net vs2003.
Is there any method to reset the binding that had done previously.
txtBox.DataBinding.Add("Text", dt, "Cid");
similarly can we reset this binding?
I read about a method ResetBinding(),
But dont know how to use it?
Does it like txtBox.ResetBindings();
If yes, then why the code-editor is not showing the method in pop-up box,
which appears when we type Control. after . a box appears showing all methods related to control, In my vs its not showing ResetBindings() method, Why?
plz help.
modified on Thursday, April 3, 2008 7:02 AM
|
|
|
|
|
txtBox.DataBindings["Text"].Clear()?
So far I have not used the individual clear. I usually clear all the databinding [.DataBindings.Clear()] when i change the datasource.
|
|
|
|
|
darkelv wrote: I usually clear all the databinding [.DataBindings.Clear()] when i change the datasource.
Can u tell me how to use this?
DataBindings.Clear() will clear all the binding attach to the form controls, or what?
|
|
|
|
|
It clears the databindings of the control.
|
|
|
|
|
What the hell is wrong with this?
myStoredProcedure definition:
UPDATE Reminders SET lastModificationTime = [@lastModificationTime]
WHERE reminderId=[@reminderId];
lastModificationTime is set to Date/Time in my table
I just want to update the damn time from my code:
<code>
updateCommand.CommandText = "myStoredProcedure"
updateCommand.Parameters.AddWithValue("lastModificationTime", DateTime.Now);
updateCommand.Parameters.AddWithValue("reminderId", 1);
updateCommand.ExecuteNonQuery();
</code>
I get a "Data type mismatch in criteria expression" for the last modification time parameter
|
|
|
|
|
Think you might want to be putting an '@' before you sql parameters in the code.
Regards,
Rob Philpott.
|
|
|
|
|
no the code works just fine as it is, the only problem is setting both a date and a time in the damn database. If i say
updateCommand.Parameters.AddWithValue("lastModificationTime", DateTime.Now.Date);
or
updateCommand.Parameters.AddWithValue("lastModificationTime", DateTime.Now.Time);
everything works fine
|
|
|
|
|
surprised at that.
Have you tried this instead:
updateCommand.Parameters.Add("@lastModificationTime", SqlDbType.DateTime).Value = DateTime.Now;
I would think you'd be fine with that.
Regards,
Rob Philpott.
|
|
|
|
|
I am working on treeview and in which I have a parent with 5 child nodes, all these 5 child holds choice property and all nodes are selected initially. The idea I want to implement is that if I try to deselect all 5 than first one should be selected. Atleast one child node always be there.any kind of code template will be great help!
structure of tree is like
P
c1
c2
c3
c4
c5
|
|
|
|
|
Can somebody help me out on how to send out CIR signal from a windows mobile Using C#....
Could you jus tell me exactly which port has to be used for this...
I'm using a HP IPAQ HX2400
pls mail me on kaushal.evanuissance@gmail.com...
|
|
|
|
|
hi,
I want to invoke a function from a C++ dll in C#, the function prototype as follows:
void F(Matrix &H,double (*ptr)[2]);
the prototype of Matrix as follows:
typedef struct
{
double array[3][3];
} Matrix;
How to pass the parameter Matrix &H and double (*ptr)[2] to F?
Any help will be appreciated!
<div class="ForumMod">modified on Thursday, April 3, 2008 5:40 AM</div>
|
|
|
|
|
you are looking for P/Invoke , you must use dllimport (and many more) look it up on google and msdn , good luck with this you will need it .
you must declere the functions as static using dllimport attribute
dll function
[DllImport("SectionDBEngine.dll", EntryPoint = "getHeadersByIndex")]
public static extern int getHeadersByIndex([In, Out] CSectionHeader[] headers, int size);
http://msdn2.microsoft.com/en-us/library/aa288468.aspx[^]
f(yf) = yf
|
|
|
|
|
I can tell you that you'll have to re-define the struct on the .NET side for sure. The second parameter seems like an array of doubles. Is that so? That will map to System.Array.
|
|
|
|
|
Hi All,
I am new with VS 2008 and also WPF Application.
I want to make a application i which i have to give look like Office 2007 instead of Menus.
i want to use Ribben UI control so for that i google it but i am unable to find proper solution that how can i prepare Ribben UI Control.
also i found some link in which they providing Ribben UI Control but not free.
Can anybody tell me that where i can get free source code for Ribben UI Control to Use in My WPF Application?
Thanks
Bankey
|
|
|
|
|
You need to buy a third party addon and accept a specific license that says you will not use the ribbon in a product that competes with Microsoft Office.
|
|
|
|
|
|
Dear gurus,
I found so much on the subject of calling a Cpp-Interface from C#, but I'm more confused now. There is no simple/understandable example.
My problem:
I have legacy-code which contains Cpp-Classes in "old-fashioned Cpp-Dll's" and I want to call interfaces of these classes from within C#-Code.
Kind regards
|
|
|
|
|
u can use DLLIMPORT from c# code
rahul
|
|
|
|
|
I don't think you can do that directly. You will have to write a C/C++ interface that will call the functions in the C++ classes. When you write your interface be careful to choose data types that will be easily marshalled by .NET.
|
|
|
|
|
Tomerland wrote: I have legacy-code which contains Cpp-Classes in "old-fashioned Cpp-Dll's" and I want to call interfaces of these classes from within C#-Code.
You can't do this directly. The classes in your C++ code have to be exposed through COM to get this to work. If they're not, you'll eitehr have to rewrite the C++ code so that they are, or write a wrapper that takes care of using the C++ classes and exposes various methods to manipulate them through COM.
Managed code cannot directly instantiate and use unmanaged code classes without a Runtime Callable Wrapper of some kind.
Tomerland wrote: There is no simple/understandable example.
Correct. That's because this is a difficult concept to understand.
|
|
|
|
|
A principal question.
I'm dealing with number-crunching applications having a rich user-interface.
To realize these applications I use a two-folded strategy:
a)
use highest-speed technology as unmanaged code,C++, pointers or assembler
b)
for the rich user-interface I want to use window-forms or wpf.
In previous days this was no problem. I used MFC; there is no integration-problem with different technologies.
But now, I have a mess. Mixing C++ and C# seems to be incredibly problematic.
If you - dear reader - have a similar type of applications, how do you solve these issues? Are you really stepping into the realm of interoperability?
Kind regards
|
|
|
|
|
Tomerland wrote: If you - dear reader - have a similar type of applications, how do you solve these issues?
I've already explained how to solve them.
Tomerland wrote: Are you really stepping into the realm of interoperability?
That's the only option you have.
|
|
|
|
|
I'll give a little very simplified example to try to get you started.
Use caution when dealing with unsafe code/pointers going
back and forth across the managed boundary. The garbage collector can change reference locations
on you as your dll is working, in that case you'll need to "pin" or use the fixed block
especially when dealing with *buffers.
say you have a .dll named "TheDll.dll" with one method: public int Add(int a int b); //...
internal static class TheDllNativeMethods{
[DllImport("TheDll.dll")]
public static extern Int32 Add(Int32 first, Int32 second);
}
public class YourClass{
public Int32 ForwardingAdd(Int32 a, Int32 b){
return TheDllNativeMethods.Add(a, b);
}
}
"Run for your life from any man who tells you that money is evil. That sentence is the leper's bell of an approaching looter." --Ayn Rand
|
|
|
|