|
I have a View menu item that offiers Large Icon, Details..... views. I would like to have the menu item have a checked sign when selected by a user and then remove the check sign when user selects a different view option.
Thank you.
Palestine
|
|
|
|
|
Tried It out and worked fine.
private void m_SortItem_Click(object sender, EventArgs e)
{
//Clearing check marks from all menu items
foreach (ToolStripMenuItem item in sortToolBtn.DropDownItems)
{
item.Checked = false;
}
//Selected the current item which is clicked.
m_SortItem.Checked = true;
}
|
|
|
|
|
Task Description:
Input to my Web Service From MQ Message Queue
The complete XML will be sent from the Message Queue
- <soapbody>
<parameter>'' 'C:\ofac\out\file110' 'cl_110' 'LN ONE' 'LN2' 'LN3' 'LN4' 'LN5' 'LN6' 'LN7' 'LN8' 'LN9' 'CN' 'PN' 'OTHERName' 'COUNTRY' 'DATA KHFUOISDUFIOUDFOIFUIOD BODY'
I want to read the parameter and send the
parameter Data forward to a process.
The results of the process should replace the value of parameter
and return the complete message received from the
queue.
I continually get this message when starting debug:
The property 'OneWay' on type 'System.Web.Services.Protocols.SoapMessage' cannot be serialized because it is decorated with declarative security permission attributes. Consider using imperative asserts or demands in the property accessors.
I am using Visual Studio .Net For development
Here's my code Snippet:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Configuration;
using System.Security;
using System.Security.Permissions;
using System.Data.SqlClient;
using System.Reflection;
using System.Xml;
namespace WebServiceGL1Way
{
///
/// Summary description for Service1.
///
//[WebService(Namespace="http://10.1.21.58/GlobalOneWay")]
public class Service1 : System.Web.Services.WebService, System.Security.IPermission
{
public Service1()
{
//CODEGEN: This call is required by the ASP.NET Web Services Designer
InitializeComponent();
}
#region Component Designer generated code
//Required by the Web Services Designer
private IContainer components = null;
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
}
///
/// Clean up any resources being used.
///
protected override void Dispose( bool disposing )
{
if(disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}
#endregion
// WEB SERVICE EXAMPLE
// The HelloWorld() example service returns the string Hello World
// To build, uncomment the following lines then save and build the project
// To test this web service, press F5
//[SoapDocumentMethod(OneWay=true)] - shot in the dark
[WebMethod]
public string GlobalService1(SoapMessage message)
{
//string msg = message.GetInParameterValue(0).ToString(); - don't know which one will get value!!!??
object param = message.GetType().BaseType.GetField("parameter");
string msg = param.ToString();
string sRunBuildXML = msg;
RunProcess(Session["BuildXML_Path"].ToString(),sRunBuildXML);
// replace returned message within element parameter
return message;
}
//............
What is missing?
Is the input formatted correctly as a soap message?
Is it really a string?
Palestine
|
|
|
|
|
1. I have a DataGrid.
2. I have a Form.
3. I have an Access DB.
4. I have a dataset.
The Form data is inserted into my DB in an isolated transaction.
After that transaction has completed, I reload my dataset which is binded to the DataGrid. I use a connection instance for me insert transaction, and another connection object for my "selects". Even though both connection objects are created from the same connection string (appended below), the data seems to not be updated with a follow up my completed transaction with a search on the newly inserted data.
Basically the data I'm submitting is not show up in my datagrid. It's like I have to wait a few seconds and search again to find it. Is Access really that slow. Why would it complete my insert and transaction if it's not done.
Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=$$$\DocuBase.mdb;Mode=Share Deny None;Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False
Palestine
|
|
|
|
|
You'll have to use one instnce troughout your app(or form) of the adapter(adp1) and assosiated connection(con) when selecting, inserting, deleteing and updateing of the dataset(ds) if you want the data to be concurrent within your grid and reflect changes as it happens. The concurrency behind the dataset & grid are maintained by currencymanagers and currency happens 'automaticlly', but you'll have to use the original instances of dataset, adapter, commands and connections objects to preserve currency of the datasets and keep them in context of its original 'data factories'.
If you have 2 adapter; one for selecting and one for insetingon the same dataset table, you will have concurrency problems. Rember that the adapter knows the states of the rows during an fill or update - the adapter only gets/changes the rows whos states has changed and/or are different as those rows in the db.
you should buy a book explaning these stuff to you. Datasets are very powerfull, but they can irretate the hell out of you if you use it the wrong way.
|
|
|
|
|
I have upgraded from .net framework 1.1 to 2.0 and also changed from MS VisualStudio 2003 to 2005. My program was obsolutely working fine 2003 and i am getting the desired output.
I will tell the problem what it is, when i debug the appln. it is not going in to the method but just skipping that stmt . when i point the cursor to that line, it is showing the message "remove group, currently there is no group object."
here is the method where the problem lies
Hashtable htable = mUsersGroups.GetAllUsersAndIDs();
There is nothing wrong with the method and i got the output what i want in 2003 version , but the problem is doesn't filter acc. to group and show all the groups. But anyhow i can give the code for u'r better understanding.
public Hashtable GetAllUsersAndIDs()
{
long userGroupID;
UGUserNode user;
SqlConnection dbc = new SqlConnection(Config.ConnectionString);
Hashtable userTable = new Hashtable();
dbc.Open();
try
{
SqlCommand sqlCommand = new SqlCommand(
"SELECT DISTINCT UserGroupID, Name " +
"FROM UserGroupTable " +
"ORDER BY Name",
dbc);
SqlDataReader sqlDataReader = sqlCommand.ExecuteReader();
while (sqlDataReader.Read())
{
if (!sqlDataReader.IsDBNull(0))
{
userGroupID = sqlDataReader.GetInt32(0);
if (nodes.ContainsKey(userGroupID))
{
//we have already seen this node!
user = (UGUserNode) nodes[userGroupID];
}
else
{
user = new UGUserNode();
user.LoginName = sqlDataReader.GetString(1);
user.UserGroupID = sqlDataReader.GetInt32(0);
user.IsActive = true;
nodes.Add(userGroupID, user);
}
userTable.Add(userGroupID,nodes[userGroupID]);
}
}
sqlDataReader.Close();
}
catch(Exception e)
{ Console.WriteLine(e.Message);}
finally {dbc.Close();}
return userTable;
}
I am not familiar with the MS VisualStudio 2005 and could not figure out what the problem is and can u resolve the problem and reply with the complete solution please,
Thanks,
Palestine
|
|
|
|
|
|
The first one can be achieved with GraphicsPath.AddArc() , followed by GraphicsPath.AddLine() to add the lower horizontal line. When you call FillPath() on your given Graphics object, the path will be closed automatically.
The second one is very similar, you'll add an Arc , a Line , and another Arc . You might have to set GraphicsPath.FillMode to FillMode.Winding in the second case or you'll get unexpected results.
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
Is it possible to compare two versions of dlls. To explain, if a class Library C, having several classes, is compiled to get C.dll with say version 1. After few months, class library undergoes some changes and a new version of C.dll is released, say with version 2. Now, Is it possible to compare C.dll of version 1 and 2.
if so, please guide me how to do.
TIA.
Ananth
|
|
|
|
|
Hello
You can always get the version of a file using The FileVersionInfo class. Here is an examplke from MSDN:
public void GetFileVersion() {
FileVersionInfo myFileVersionInfo = FileVersionInfo.GetVersionInfo("%systemroot%\\Notepad.exe");
textBox1.Text = "File: " + myFileVersionInfo.FileDescription + '\n' +
"Version number: " + myFileVersionInfo.FileVersion;
}
Regards
|
|
|
|
|
Hi
Thanks for the info. But I need more than that.
Is it possible to compare two dlls (with different versions) having similar code base. For more details on the query, refer to my earlier posting.
Regards,
Ananth
|
|
|
|
|
Hello
In your earlier post you said
Ananthalvan wrote: Is it possible to compare two versions of dlls.(
So I understood that you need to compare the version itself -maybe I was wrong-
No you say
Ananthalvan wrote: Is it possible to compare two dlls
Yes, it's always possible. Yet, in what manner do you want to compare them?? By what exactly? By refering to your earlier post -as you said-, all you were talking about was classes. So if you want to get the names of te classes in a dll, just use Reflection.
Type "Reflection" in MSDN's index and you'll get more informations.
Regards
|
|
|
|
|
Dear Friends
I have an employee master form wiht having 5 tables. My requuirement is when the user opens the form, it must be the add new record mode. My problem is i can add new employee first time. After saving am reseting the dataset using clear(). After that when i add the next employee, it throws error saying the index out of range. This is when i refer the row[0] of the emp data adapter.
//*********** MY Reset script
dsEmp.Clear();
this.BindingContext[dsEmp, "HR_M_EMPLOYEE"].EndCurrentEdit();
this.BindingContext[dsEmp, "HR_M_EMPLOYEE"].AddNew();
this.BindingContext[dsEmp, "HR_M_EMP_EAR_DED_EAR"].EndCurrentEdit();
this.BindingContext[dsEmp, "HR_M_EMP_EAR_DED_EAR"].AddNew();
this.BindingContext[dsEmp, "HR_M_EMP_EAR_DED_DED"].EndCurrentEdit();
this.BindingContext[dsEmp, "HR_M_EMP_EAR_DED_DED"].AddNew();
this.BindingContext[dsEmp, "HR_M_EMP_DOCUMENTS"].EndCurrentEdit();
this.BindingContext[dsEmp, "HR_M_EMP_DOCUMENTS"].AddNew();
this.BindingContext[dsEmp, "HR_M_EMP_DEPENDENTS"].EndCurrentEdit();
this.BindingContext[dsEmp, "HR_M_EMP_DEPENDENTS"].AddNew();
this.BindingContext[dsEmp, "HR_M_EMP_QUALIFICATIONS"].EndCurrentEdit();
this.BindingContext[dsEmp, "HR_M_EMP_QUALIFICATIONS"].AddNew();
this.BindingContext[dsEmp, "HR_M_EMP_CERTIFICATION"].EndCurrentEdit();
this.BindingContext[dsEmp, "HR_M_EMP_CERTIFICATION"].AddNew();
this.BindingContext[dsEmp, "HR_M_EMP_EXPERIENCE"].EndCurrentEdit();
this.BindingContext[dsEmp, "HR_M_EMP_EXPERIENCE"].AddNew();
this.BindingContext[dsEmp, "HR_M_EMP_SKILLS"].EndCurrentEdit();
this.BindingContext[dsEmp, "HR_M_EMP_SKILLS"].AddNew();
this.BindingContext[dsEmp, "HR_M_EMPLOYEE_PHOTOS"].EndCurrentEdit();
this.BindingContext[dsEmp, "HR_M_EMPLOYEE_PHOTOS"].AddNew();
errEmpForm.Clear();
//*********** end of Reset script
When user save the employee, am setting some values to the hiden columns
Error is appearing here
this.BindingContext[dsEmp, "HR_M_EMPLOYEE"].EndCurrentEdit();
if (dsEmp.Tables["HR_M_EMPLOYEE"].Rows[0].RowState == DataRowState.Added)
{
dsEmp.Tables["HR_M_EMPLOYEE"].Rows[0]["N_COMP_CODE"] = GlobalMembers.gi_compcode.ToString();
dsEmp.Tables["HR_M_EMPLOYEE"].Rows[0]["N_USER_CODE"] = GlobalMembers.gi_usercode.ToString();
dsEmp.Tables["HR_M_EMPLOYEE"].Rows[0]["D_MODTIME"] = DateTime.Now.ToString();
}
What i need is after saving the employee, the form must be Add new record mode.
How can i achieve this. Am sure that am wrong somewhere. I dont know how can i do this. Even though am calling the AddNew using the binding contect, the new record is not reflecting.
I need help. If reuired the complete script i can send that also, it is very very big.
Plsss help meeee, i have the deadling next week.
Vinu M
|
|
|
|
|
I need Run Movie On Tv Using Video card
Topic Directx 9
Code In C# or vb.net
Problem Detai:
I want to run mpeg file in my form window which is design in (C# or Vb.net)
display should be simultaniusly form and TV (AV1 chanal).
Thanks
i wana script
i wana script
|
|
|
|
|
Dear Experts,
I have searched for days everywhere for an example on how to do this, and found many examples, but none of them do exactly what is needed.
I have a C# application where I need to drag files from a listview that are compressed in an archive to an Explorer window, and need to execute custom decompression code to extract the files after they are dropped. This decompression can take quite long if the files are large. There are no examples how to do this anywhere. This is currently being done in WinZip and WinRAR, so it appears to be possible.
This link shows a method that seems promising and most articles point to it:
http://blog.joycode.com/felix/articles/38825.aspx
In this article he creates a custom DataObject with an override for the GetData method. I still cannot make it work. The files get moved but are 0 length. It must have something to do with the timing of when the events and methods fire. I guess I don't fully understand the entire sequence of events.
If we can only get the path to the drop folder, but that is not possible.
This exact question was asked on EE, but the author finds out how to do it before a solution is posted and does not really share it in enough detail to help other users:
http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/Q_21554101.html?query=drag+drop+explorer&topics=323
If anyone has implemented this, please help.
-Frank
|
|
|
|
|
more info...
The sample from blog.joycode.com should work, but I guess I don't understand the order events happen. If you look at the code below, I adapted the custom DataObject for my application based on what was in the article. When you drop the items, GetData() gets called multiple times. My custom UnzipFiles() gets called, and the files get extracted to the temp folder where the original temp files were created when I first start the drag from the list. But it seems that it copies the zero length files before the extracted versions get created. It's definitely a timing issue.
public class ShellDataObject: DataObject
{
private bool downloaded = false;
private DlgExtract _dlg;
public override object GetData(String format)
{
Object obj = base.GetData(format);
if (System.Windows.Forms.DataFormats.FileDrop == format && !InDragLoop() && !downloaded)
{
_dlg.UnzipFiles(System.IO.Path.GetTempPath(), _dlg.ZipContentsList.SelectedItems);
downloaded = true;
}
return obj;
}
public DlgExtract BaseDialog
{
set { _dlg = value; }
}
private bool InDragLoop()
{
return (0 != (int)GetData(ShellClipboardFormats.CFSTR_INDRAGLOOP));
}
}
|
|
|
|
|
Frank, the keyt here is the InDragLoop thing. You need to do your extraction while you are in drag loop. I've successfully achieved this; in my application, when the user drag/drops a file out of our .NET application, I make a connection to a remote database, get the file data out of it, and write it to disk. I accomplished this using the technique shown on the blog.
IIRC, the key is the InDragLoop. You can report to Windows that you're in drag loop, at which time you can extract the compressed data and write it to disk. Once you're done, that's when you exit the drag loop. This is all off the top of my head; it's been a long time since I coded this up.
Try that (do your file processing while you're in the drag loop) and study that example; if done correctly, it should accomplish what you're trying to do. If you still can't get it, let me know and I'll see if I can't cook up an example.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Goof around music jam with my brothers (with video)
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
I finally got it to work. I sort of had it all along, but what I needed to do is modify the CreateTemporaryFileName() to store the full path. It then started working.
Thanks for the help Judah.
private String CreateTemporaryFileName(String name)
{
String path;
String fileName;
System.IO.StreamWriter file;
path = System.IO.Path.GetTempPath();
fileName = path + name;
file = new System.IO.StreamWriter(fileName);
file.Close();
return fileName;
}
|
|
|
|
|
Cool, glad you got it working Frank.
|
|
|
|
|
Hi,
I used to work with VS 2003 and it has a feature that helped you to pin point when an exception was thrown. You could set the debugger to break when an exception was thrown (1st chance) rather than when an exception was not handled in the code (2nd chance).
In VS 2005 with the exception assistance which I can't find how to configure to do the same thing.
Can someone tell me how to do it?
Till than I am using the cordbg.exe to do this.
Ami
|
|
|
|
|
Hello
Quoted from MSDN: To break execution when an exception is thrown
On the Debug menu, click Exceptions.
In the Exceptions dialog box, select Thrown for an entire category of exceptions, for example, Common Language Runtime Exceptions.
-or-
Expand the node for a category of exceptions, for example, Common Language Runtime Exceptions, and select Thrown for a specific exception within that category.
Regards
|
|
|
|
|
This is good for VS 2003, in 2005 you don't have this option
|
|
|
|
|
What?? My Visual Studio is 2005 alright, and I have the option?!! Try pressing Ctrl+D, then you press E
Regards
|
|
|
|
|
|
You are welcome.
Regards
|
|
|
|
|