|
Personally, I would write a wrapper around it in C#. Not necessarily easy or fast but the most flexible in the longrun IMO.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
You got it in 1. If you do it personally, it will be both easy and fast.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
C++/CLI is a good candidate for this. Create a mixed mode assembly using C++/CLI and refer it in your C# project.
|
|
|
|
|
You could create COM component using native C++,register it and and next create runtime callback wrapper for the component.After doing it you could add the RCW assembly to your project and directly use it.It's better than using dllImports beacause it allows easy to use COM/MFC/CRT libraries.
It's much more better C++/CLI because this version is not enough scalable -in fact it consumes a lot of resources for type marshaling.I wrote a sample application using C++/CLI an year ago and I was badly surprised how much memory it requires to run-up to three times more than the same app written in C#.That's why COM is the best solution but it's also the most complicated too.
Regards!
|
|
|
|
|
Hi,
currently i am using devAge source grid.
Can any one help for how to set maxlength for any column cell
how to bind combobox of devAge for default set to Null and autocomplete feature like normal combo of .net 2.0.
- Parth Gandhi
|
|
|
|
|
You are likely to get a better answer on their page here[^]
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Is it possible to add tree control in sourcegrid column?//
-- pgandhi
|
|
|
|
|
As before. Ask on the site of the maker of the control.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Good morning.
I have populated a DataGridView with a dataset from a query off a table in SQL Server 2005. Now when a user makes changes in the DataGridView and clicks on a 'Save' button, I want the dataset to be updated and the table to reflect the changes. The datagrid is on a form and all the queries are called from the DAL.
My code is as follows:
private void btnQuery_Click_1(object sender, EventArgs e)
{
PwdSecurity p = new PwdSecurity();
uipc = this.Parent as UIPCMainForm;
const string constrallowedBlockTypes = "allowedBlockTypes";
DAL d = new DAL(uipc.StrUserName, p.base64Decode(uipc.StrPassword));
DataSet ds = new DataSet();
ds = d.AllowedTypes(constrallowedBlockTypes);
BindingSource bs = new BindingSource();
bs.DataSource = ds;
bs.DataMember = ds.Tables[0].TableName;
dgv.DataSource = bs;
}
DAL:
myConnection =
new SqlConnection("server=PTLLBNB0DD1\\SQLSERVER2005;database=IPControl;Trusted_Connection=yes");
public DataSet AllowedTypes(string Type)
{
string SQL = String.Empty;
ds = new DataSet();
try
{
SqlCmd = new SqlCommand("spGET_ALLOWED_TYPE", myConnection);
SqlCmd.CommandType = CommandType.StoredProcedure;
SqlCmd.Parameters.Add("@Type", SqlDbType.VarChar, 50);
SqlCmd.Parameters["@Type"].Value = constrallowedDeviceTypes;
if (myConnection != null) { myConnection.Close(); }
myConnection.Open();
SqlAdapt = new SqlDataAdapter(SqlCmd);
SqlAdapt.Fill(ds);
}
catch (Exception e)
{
MessageBox.Show("DAL Layer / AllowedTypes method error. \n\r \n\r" +
e.Message.ToString() + " \n\r \n\r" + SQL);
}
finally
{
if (con != null) { con.Close(); }
if (aCommand != null) { aCommand.Dispose(); }
if (adapter != null) { adapter.Dispose(); }
}
return ds;
}
If I had access to the SqlAdapt, I could probably use SqlAdapt.Update(ds), but i don't currently.
Any suggestions?
WHEELS
|
|
|
|
|
|
Please clerify. That picture doesn't have any connection to your question and i don't understand the writing
|
|
|
|
|
|
|
I konw this method,but that ont isn't what I want.and thank you advance.
I will look for a new method to deal with this question.
你懂汉语吗?
|
|
|
|
|
I want to replace the double backslash with a single backslash. The following code does not work.
pResult.Path = pResult.Path.Replace(@"\\", @"\");
It does not do any replacement at all. How can this be accomplished?
|
|
|
|
|
That should work as is. If you're looking at it in the watch window, be mindful that Visual Studio already escapes special characters with a slash. If you click on the magnifying glass (the visualizer), you should be able to see the 'unescaped' version of the string.
|
|
|
|
|
You are right, it did work. Thanks for the clarification.
|
|
|
|
|
Getting the data from the tags of a TIFF image
I'm trying to make a program that opens a TIFF image and puts the data from the tags in texboxs but I do not know how to extract the data. If anyone knows how can help me.
thanks
|
|
|
|
|
Hi,
here is some code I've been using for that purpose, it was aiming at JPEG though:
FileStream stream=new FileStream(fileSpec, FileMode.Open, FileAccess.Read);
Image localImage2=Image.FromStream(stream);
#if true
int[] piList=localImage2.PropertyIdList;
Dictionary<int, string> propNames=new Dictionary<int,string>();
propNames.Add(0x010E, "ImageDescription");
propNames.Add(0x010F, "EquipMake");
propNames.Add(0x0110, "EquipModel");
propNames.Add(0x0112, "Orientation");
propNames.Add(0x011A, "XResolution");
propNames.Add(0x011B, "YResolution");
propNames.Add(0x0132, "DateTime");
propNames.Add(0x0128, "ResolutionUnit");
propNames.Add(0x0131, "SoftwareUsed");
propNames.Add(0x0201, "JPEGInterFormat");
propNames.Add(0x0202, "JPEGInterLength");
propNames.Add(0x0213, "YCbCrPositioning");
propNames.Add(0x501B, "ThumbnailData");
propNames.Add(0x502D, "ThumbnailResolutionX");
propNames.Add(0x502E, "ThumbnailResolutionY");
propNames.Add(0x5090, "LuminanceTable");
propNames.Add(0x5091, "ChrominanceTable");
propNames.Add(0x829A, "ExifExposureTime");
propNames.Add(0x9003, "ExifDTOrig");
propNames.Add(0x9004, "ExifDTDigitized");
propNames.Add(0x9204, "ExifExposureBias");
propNames.Add(0x9209, "ExifFlash");
propNames.Add(0x927C, "ExifMakerNote");
propNames.Add(0x9286, "ExifUserComment");
propNames.Add(0xA002, "ExifPixXDim");
propNames.Add(0xA003, "ExifPixYDim");
foreach (int ID in piList) {
if (propNames.ContainsKey(ID)) getPropertyItem(localImage2, ID, propNames);
}
#endif
localImage=new Bitmap(localImage2);
stream.Close();
localImage2.Dispose();
and
protected void getPropertyItem(Image image, int ID, Dictionary<int, string> propNames) {
string s=(string)propNames[ID];
if (s==null) s="";
s+=new string(' ', 20);
s=s.Substring(0, 20);
string name="Prop"+LP_Format.Hex4(ID)+" "+s;
string type=null;
try {
PropertyItem pi=image.GetPropertyItem(ID);
s="";
byte[] bb=pi.Value;
switch ((PropertyTagType)pi.Type) {
case PropertyTagType.Byte:
type="(byte)";
for (int i=0; i<bb.Length; i++) {
byte us=bb[i];
s+=" "+us.ToString("X2");
if (bb.Length==1) s+="("+us.ToString()+")";
}
break;
case PropertyTagType.ASCII:
type="(ASCII)";
s=" "+ASCIIencoding.GetString(pi.Value, 0, pi.Len-1);
break;
case PropertyTagType.Short:
type="(short)";
for (int i=0; i<bb.Length/2; i++) {
ushort us=BitConverter.ToUInt16(bb,2*i);
s+=" "+us.ToString("X4");
if (bb.Length==2) s+="("+us.ToString()+")";
}
break;
case PropertyTagType.Long :
type="(long)";
for (int i=0; i<bb.Length/4; i++) {
ulong us=BitConverter.ToUInt32(bb,4*i);
s+=" "+us.ToString("X8");
if (bb.Length==4) s+="("+us.ToString()+")";
}
break;
case PropertyTagType.Rational:
type="(rational)";
for (int i=0; i<bb.Length/8; i++) {
uint uNominator=BitConverter.ToUInt32(bb, 8*i);
uint uDenominator=BitConverter.ToUInt32(bb, 8*i+4);
s+=" "+uNominator.ToString()+"/"+uDenominator.ToString();
}
break;
case PropertyTagType.Undefined:
type="(undefined)";
for(int i=0; i<bb.Length; i++) {
s+=" "+bb[i].ToString("X2");
}
break;
case PropertyTagType.SRational:
type="(srational)";
for (int i=0; i<bb.Length/8; i++) {
int uNominator=BitConverter.ToInt32(bb, 8*i);
int uDenominator=BitConverter.ToInt32(bb, 8*i+4);
s+=" "+uNominator.ToString()+"/"+uDenominator.ToString();
}
break;
}
if (type==null) type="?"+pi.Type+"?";
env.log(0, name+LP_String.Extend(type, 12)+s);
} catch (Exception exc) {
env.log(0, "Unable to obtain "+name+"; "+exc.Message);
}
}
Hope this helps.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Hi,
I'd a DataTable where I'd filled the data using SQL Statement "SELECT CONVERT(VARCHAR,DOB,105) AS DOB FROM TABLENAME".
Here the DataTable is filled with Dates by using the format "dd-MM-yyyy"
My problem is I need to apply the Filter viz., =, >, >=, <, <= on the DataTable based on the input given by the user in the same format "dd-MM-yyyy" irrespective of the datetime setting in the user system.
Can any one suggest on this.
Thanks in Advance
Sreedhar Kadiyala
|
|
|
|
|
In your select statement include a where clause the would be a built string based on the input the user entered. For example:
"WHERE mydate < CONVERT(DATETIME, '" + "07/01/2009" + "00:00:00', 103)"
Replace 07/01/2009 with logic that would build that part of the string based on the user inputs.
|
|
|
|
|
Hi,
Take the input from the user which would be in the form of '=, >, >=, <, <=' and the string with this try to make a filter condition and apply it to the rowFilter of the dataview.You will surely get..
Regards
Anju
|
|
|
|
|
Hi,
I can't see what's wrong with this code. I am getting "1/2/2009 9:00:00 AM" displayed in the textBox when I'm expecting "1/2/2009 9:00:00 PM". Can anyone tell me what I'm doing wrong here, please?
DateTime dateTime;
DateTime.TryParseExact("1/2/2009 9:00 PM", "d/M/yyyy H:m tt", CultureInfo.InvariantCulture, DateTimeStyles.None, out dateTime);
textBox1.Text = dateTime.ToString();
I'm using VS2008 and targeting .NET 3.5 and have "en-AU" as the default Windows culture.
Thanks, Henk.
|
|
|
|
|
|
Thanks stancrm, I was reading up on the "g" you used and that led me to Custom Format Strings at http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx[^] where I realised I should be using h instead of H if I'm wanting to parse the AM/PM part. Thanks for assisting. Regards, Henk.
|
|
|
|
|