|
hi,
im working in a trial version of vs2005
and if i am useing databases, link them with a datagrid using the wizard, it doesn't generate a delete statment, therefor i always get an error when i want to delete and update afterwords.
this is the error:
update requires a valid delete command when passed datarow collection with deleted rows
could this be because of the trial??
plllzzzzz help meeeee
|
|
|
|
|
faladrim wrote: could this be because of the trial??
No. It's more likely that you'll need to add a valid delete statement.
Also, a trial of Visual Studio? Do you mean the Visual Studio Express version? If so, that's not a trial.
|
|
|
|
|
can somebody help me?
how can i check a checkbox in a checkbox cell?
my currenty code is like that:
<br />
colValueCheckBox.TrueValue = "1";<br />
<br />
DataGridViewCheckBoxCell cellValue = colValueCheckBox.CellTemplate.Clone() as DataGridViewCheckBoxCell;<br />
<br />
cellValue.Value = "1";<br />
gridRow.Cells.Add(cellValue);<br />
grid.Rows.Add(gridRow);<br />
but it doesent check the box in that cell
(i need some code to check this box! - can be different to that)
THNX
|
|
|
|
|
I'm not too familiar with the DataGridView, but have you tried doing something like cellValue.Value = true; ?
|
|
|
|
|
ok thats what i already tried to check this box, too:
<br />
cellValue.Value = true;<br />
cellValue.Value = colValueCheckBox.TrueValue;<br />
i also tried cellValue.Value = true; without setting any TrueValue or FalseValue.
i also tried to test it with ThreeState = true; .
|
|
|
|
|
Ok, i found the answer, i added the checkboxcell to a invisible column, and i didn't think about that as i add the cell of a row.
|
|
|
|
|
Hi all
Im trying to load a dll programmed in C, but I'm not sure exactly how to go about it. I read the following article:
http://msdn.microsoft.com/msdnmag/issues/02/08/CQA/
My problem is that Im not quite sure how to handle the return types. In the header file I several type definitions. Below you see some of the type definitions and two of the methods availeble in the DLL.
<br />
<br />
#if defined (OMA_LIB_INTERNAL)<br />
# define OMA_DLLEXPORT DLLEXPORT<br />
<br />
#else<br />
# define OMA_DLLEXPORT DLLIMPORT<br />
#endif<br />
<br />
<br />
#define OmaC_Ov_Default_Report_Name ""<br />
#define OmaC_Ov_Global_Object_Path ""<br />
#define OmaC_Ov_Unspec_Str "unspecified"<br />
<br />
<br />
typedef struct OmaT_Ov_Writer OmaT_Ov_Writer;<br />
typedef struct OmaT_Ov_Reader OmaT_Ov_Reader;<br />
typedef struct OmaT_Ov_Vector OmaT_Ov_Vector;<br />
typedef struct OmaT_Ov_Reader_Iterator OmaT_Ov_Reader_Iterator;<br />
......<br />
<br />
<br />
<br />
<br />
OMA_DLLEXPORT OmaT_Ov_Reader *<br />
Oma_Ov_Reader_Open (const char *ov_file_name);<br />
<br />
OMA_DLLEXPORT OmaT_Ov_Vector *<br />
Oma_Ov_Reader_Vector_Get (OmaT_Ov_Reader *ov_reader_ptr,<br />
const char *report_name, const char *obj_path,<br />
const char *group_and_stat_name);<br />
......
My question is: How I use import this DLL?
At the moment I have an idea that it should be something like the following, but I have no clue how to define the structs which Im using and which gets returned. See below:
public class OMAInterface<br />
{ <br />
<br />
[StructLayout(LayoutKind.Sequential)]<br />
public struct OmaT_Ov_Vector<br />
{<br />
}<br />
<br />
[StructLayout(LayoutKind.Sequential)]<br />
public struct OmaT_Ov_Reader<br />
{<br />
}<br />
<br />
[DllImport("opoma_opt.dll")]<br />
public static extern OmaT_Ov_Reader* Oma_Ov_Reader_Open (const char *ov_file_name);<br />
{}<br />
<br />
[DllImport("opoma_opt.dll")]<br />
public static extern OmaT_Ov_Vector* Oma_Ov_Reader_Vector_Get (OmaT_Ov_Reader *ov_reader_ptr, const char *report_name, const char *obj_path, const char *group_and_stat_name);<br />
{}<br />
}
Any help is much appreciated
Christian
|
|
|
|
|
Hi,
I have a small problem. I want to create 2 properties to one of my classes. All I want is to make easier for the users of my class to get some data out of my class. I want when a user writes
Test[i] to get some data and when the user writes
Test[i][j] to get another type of response.
I need a little help with the second type of property:
public class Test
{
public object this[int index]
{
get
{
}
}
}
This one works. My question is how to write the second one?
Thanks in advance
Do your best to be the best
|
|
|
|
|
The second is a result of the first.
Test[i][j] can be broken down like this:
B someB = someA[i];
object result = someB[j];
or it can be written in a compressed form like this:
object result = someA[i][j];
The classes look like this:
public A
{
public B this[int index]
{
get
{
return stuff
}
}
}
public B
{
public object this[int index]
{
get
{
return stuff
}
}
}
Does this help?
|
|
|
|
|
Thanks a lot. It really works
Do your best to be the best
|
|
|
|
|
If the returning type from your indexer has indexer, it will work.
Otherwise i don't see a simpler way to implement this.
|
|
|
|
|
Why don't you add another indexer with 2 parameters.
|
|
|
|
|
What is the difference between the types "String" and "string"? Intellisenseless gives the same description.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
There's no difference, string is simply a C# alias for System.String
|
|
|
|
|
String is the actual .NET type, it's fully qualified name is System.String . As for string , it's a C# keyword that's simply an alias for System.String . They are the same thing; string is just a C#-specific alias for System.String .
In a similar fashion,
System.Int32 is the actual .NET 32-bit integer type, and int is a C# keyword that's an alias for System.Int32.
Same correpsonds to System.Single and float , System.Double and double , and so on.
|
|
|
|
|
The folder should not be accessed by anyone.
vimal
|
|
|
|
|
Change the permission at the file system level
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
Hi all!
Mission: take a bitmap (which is saved on the harddisk), convert it to another, with given size and color depth, and save.
Code:
// load the original bitmap from hard disk
Bitmap originalBmp = new Bitmap( path );
// create a new bitmap with needed size
Bitmap bmp = new Bitmap( originalBmp, new Size( 32, 32 ) );
// find the codec for saving ("GetCodecInfo" browses all known codecs and
// finds the needed one; it works fine)
ImageCodecInfo codec = GetCodecInfo( "image/bmp" );
EncoderParameters parameters = new EncoderParameters( 1 );
// set the color depth
parameters.Param[0] = new EncoderParameter( Encoder.ColorDepth, 8L );
// save the bitmap
bmp.Save( path, codec, parameters );
Problem: no matter what i do, the color depth of the resulting bitmap is always "truecolor" (i.e., 24 bpp). What am i doing wrong? I've seen very similar samples on MSDN, where MS claim that this is the way to control the color depth. But it doesn't work!
Thanks!
Gal S.
|
|
|
|
|
How can i use winmm.dll to adjust the master volume of Windows
|
|
|
|
|
|
Is there any way to replace a Bitmap image (in a resource) to a loaded (in-memory) DLL?
Example...
App.exe
-> resource.dll
-> other.dll
-> interface.dll
Lets say app.exe loads each of the above dll's in the order listed. What I need is code in the interface.dll, which modifies/changes/updates a bitmap resource in resource.dll whilst in memory. The bitmap will not always be the same size and colours, so the entire bitmap and colour map will need to be updated. Bitmap image will never use any more than 16 colours.
App.exe does not display the associated bitmap before the interface.dll is loaded in memory. I am using standard C API (non MFC).
I am trying to avoid committing the changes to the actual dll file itself (on disk) if that is possible (ie. need to update the in-memory dll). I can get a handle to the interface.dll module and associated bitmap resource image using, but not sure what to do from there:
hMod = GetModuleHandle("interface.dll");
hRes = FindResource(hMod, MAKEINTRESOURCE("my_bitmap_image"), RT_BITMAP);
hGlob = LoadResource(hMod, hRes);
I know it can be done, as I have seen it done, but unable to get the source code.
Thanks in Advance
Goldmine
|
|
|
|
|
Dear Sir
Can I assign any ProcessName to my program. for ex. my program is A.exe, Is there any way to rename it to B.exe in task manager list?
|
|
|
|
|
Open explorer and rename A.exe to B.exe.
That's probably not what you wanted but hey, I'm in that kind of mood. On a more serious note, I don't think there's any easy way.
[edit]Have you tried changing the Application Name in the Properties pages?[/edit]
|
|
|
|
|
Cybercockroach wrote: Can I assign any ProcessName to my program. for ex. my program is A.exe, Is there any way to rename it to B.exe in task manager list?
Not if it's already running. The process name in task manager is the physical name of your process; your executable's name.
|
|
|
|
|
I want to do this because I have to run the same program at the same time(may be ten times) with different arugement. and I only have the same name in task manager with different pid. I dont know which process run with which arugement. So I would like my process named as my ProcessName+arugement in task manager. thanks for your reply^^ and sorry for my poor english
|
|
|
|