|
Hi Manas
yes, hence i change max length from 255 to 16 in DataSet Designer(in visual stduio), but the problem was not solved.
|
|
|
|
|
hdv212 wrote: i change max length from 255 to 16 in DataSet Designer(in visual stduio),
you need to change the size in your SQL Server table
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
i can not change size in sql server table, because it is uniqueidentifier and it's fix size is 16.
|
|
|
|
|
Deleted ( sorry I post a stupid answer )
I know nothing , I know nothing ...
|
|
|
|
|
This is the error I was getting while installing a in-process dll (BHO) setup which is made in Vs2005 using c#
"could not load file or assembly 'Microsoft.mshtml, version=7.0.3300.0,Culture=neutral,PublicKey=b03f5f7f11d50a3a' or one of its dependencies. The System cannot find the file specified."
For this, I googled and found that Microsoft.mshtml should be installed in GAC or should be available in IE installation folder.
I tried the second one, but still the dll doesnot gets injected?
Anyone can suggest something to solve this?
|
|
|
|
|
Is it even a .NET DLL ?
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
Hi,
I have create a simple vbscript called vbscriptSample.vbs
When you double click it, you see the message Hello.
This script is saved in the local machine i.e. c:\work\vbscriptSample.vbs
I can call this script using:
System.Diagnostics.Process.Start(@"c:\work\vbscriptsample.vbs");
Question:
I am developing a .net application to trigger this local script but to run it against a network machine i.e. MachineB
So when you run it from my local machine, then the message Hello appears on the MachineB
I believe this is to do with WMI
So, this is what I have. It does not give an error but the message hello does not appear.
try
{
ManagementPath p = new ManagementPath(@"\\MachineB\root\cimv2:Win32_process");
ManagementClass m = new ManagementClass(p);
m.InvokeMethod("Create", new object[] {@"\\MachineB\c$\work\vbscriptsample.vbs"});
}
catch (ManagementException err)
{
MessageBox.Show("An error occurred while trying to execute the WMI method: " + err.Message);
}
catch (UnauthorizedAccessException unauthorizedErr)
{
MessageBox.Show("Connection error (user name or password might be incorrect): " + unauthorizedErr.Message);
}
Any thoughts please?
Thanks
|
|
|
|
|
Have a look at this[^].
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Yes, I have been looking at this site but not sure how to sort out the settings
Thanks
|
|
|
|
|
I have now been through the suggested settings.
Still get Access Denied.
I can however ping the remote machine but can not use the code.
Here is the code.
Not sure why I get the Access Denied error on th einvoke line.
Any thought please?
Thanks
string stringCommandLine = "notepad.exe";
System.Management.ManagementOperationObserver observer = new System.Management.ManagementOperationObserver();
System.Management.ConnectionOptions conn = new System.Management.ConnectionOptions();
conn.Impersonation = ImpersonationLevel.Impersonate;
conn.EnablePrivileges=true;
conn.Authentication=AuthenticationLevel.Default;
System.Management.ManagementScope ms = new System.Management.ManagementScope("\\\\" + "11.3.432.76" + "\\root\\cimv2", conn);
ms.Connect();
System.Management.ManagementPath path = new System.Management.ManagementPath("Win32_Process");
System.Management.ManagementClass processClass = new System.Management.ManagementClass(ms, path, null);
object[] methodArgs = { stringCommandLine, null, null, 0 };
processClass.InvokeMethod(observer, "Create", methodArgs);
|
|
|
|
|
Can a form be minimized and maximized by a user control like Button or something else?
modified 6-Jun-21 21:01pm.
|
|
|
|
|
Of course it can. It can ask for it's parent form, or it can fire a delegate and the main form can consume it and do the work.
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
I am still not able to understand if you can send me some code-bytes to add help.
modified 6-Jun-21 21:01pm.
|
|
|
|
|
I have a datagridview with 3 columns and I would like to have the cells in 2 first columns to not be selectable in the form but the cells in the 3rd column should be selectable.
Any help welcome.
Thanks
|
|
|
|
|
In the CellStateChanged event, check for the column index of the cell and if it 0 or 1 set Selected property to false.
जय हिंद
|
|
|
|
|
I have an application running on a PDA that currently uses the OnClick Event of a DataGrid to perfortm some functionality. I would like to have the same functionality run when the current row of my DataGrid is highlighted (by the user scrolling ro it instead of clicking on it). The method to use would seem to be OnSelectedIndexChanged but this does not seem to be available in the Compact Framework (3.5). I The OnGotFocus doesn't seem to be suitable either (I guesss that this is because it applies to the DataGrid itself and not the row). Can anyone suggest how I can get this to work. Note that I only want the event to fire when the user moves to the row and not when the grid is populated.
Thanks
|
|
|
|
|
Just use the Mouse or Click Events exposed by the datagrid.
and get its CurrentRowIndex. You may have to bind the datagrid datasource using the CurrencyManager.
Then just build a DataRowView from it.
I'm not sure if this is what you are asking.
BTW. you should post this in Mobile Development.
Regards
M Curley.
|
|
|
|
|
The problem is that I will not be clicking on the grid so the onClick event won't fire. I will just be using the button thing at the bottom of the PDA ro scroll down the list. I was looking for an event that would fire when the row was highlighted. The SelectedIndexChanged looked like the one for me but that doesn't seem to be available in the Compact Framework.
I will post this again on the Mobile Development board and make my question a bit clearer. Thanks for your reply anyway.
|
|
|
|
|
Create an integer variable.
Then load the datagrid and select the first row by using
dataGrid.Select(0)
Then capture the up and down keys on the form and increment or decrement
this variable and pass this to the dataGrid
dataGrid.Select(your_variable_here)
Would this not achieve what you want to do?
Regards
Mick Curley
|
|
|
|
|
I had a bho application developed in Vs2005 c#, I had made an msi setup, when I was trying to install
the setup, it is successfully getting installed, but the dll does not gets injected in the registry.
Why?
The registry path is "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Browser Helper Objects"
But this is succesfully injected in other Pc's
The .Net framework2.0 is present in all PC's
Code for registering and unregistering:
public static string BHOKEYNAME = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Browser
Helper Objects";
[ComRegisterFunction]
public static void RegisterBHO(Type type)
{
RegistryKey key = Registry.LocalMachine.OpenSubKey(BHOKEYNAME, true);
if (key == null)
{
key = Registry.LocalMachine.CreateSubKey(BHOKEYNAME);
}
string guidString = type.GUID.ToString("B");
RegistryKey bhoKey = key.OpenSubKey(guidString, true);
if (bhoKey == null)
{
bhoKey = key.CreateSubKey(guidString);
}
// NoExplorer:dword = 1 prevents the BHO to be loaded by Explorer
string _name = "NoExplorer";
object _value = (object)1;
bhoKey.SetValue(_name, _value);
key.Close();
bhoKey.Close();
}
[ComUnregisterFunction]
public static void UnregisterBHO(Type type)
{
RegistryKey registryKey = Registry.LocalMachine.OpenSubKey(BHOKEYNAME, true);
string guid = type.GUID.ToString("B");
if (registryKey != null)
registryKey.DeleteSubKey(guid, false);
}
In some PC's the dll gets registered and in some PC's dll doe not gets registered
|
|
|
|
|
could not load file or assembly 'Microsoft.mshtml, version=7.0.3300.0,Culture=neutral,PublicKey=b03f5f7f11d50a3a' or one of its dependencies. The System cannot find the file specified.
|
|
|
|
|
I cannot figure out how to translate the following line of code:
int maxMagicBytesLength = imageFormatDecoders.Keys.OrderByDescending(x => x.Length).First().Length;
into equivalent .Net 2.0 (C# 2.0) code.
Here's the declaration of the imageFormatDecoders dictionary:
private static Dictionary<byte[], Func<BinaryReader, Size>> imageFormatDecoders = new Dictionary<byte[], Func<BinaryReader, Size>>()
{
{ new byte[] { 0x42, 0x4D }, DecodeBitmap },
{ new byte[] { 0x47, 0x49, 0x46, 0x38, 0x37, 0x61 }, DecodeGif },
{ new byte[] { 0x47, 0x49, 0x46, 0x38, 0x39, 0x61 }, DecodeGif },
{ new byte[] { 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A }, DecodePng },
{ new byte[] { 0xff, 0xd8 }, DecodeJfif },
};
As my rest of the application is .net 2.0. I just can't figure out the use of the OrderByDescending() method. I've not worked in C# 3.0 or later versions. Please help me.
Thanks in advance.
Excuse me for buttin' in, but I'm interrupt driven.
|
|
|
|
|
Ankit Rajpoot wrote: OrderByDescending(x => x.Length).First().Length;
This code orders the collection from highest to lowest, based on the length, then grabs the first object. You could just iterate over the objects, and store the highest length.
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
I want to type the special characters in C#.I don't know how to do that?Please help me.Thanks alot!!!!!
|
|
|
|
|
Do you mean how do you type them into the IDE ? The same way you did, you get them and paste them. There's a character map that gives you access.
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|