|
hi i read this website on getting read/writing to excel 2007 coding
http://msdn2.microsoft.com/en-us/library/bb332058.aspx[^]
this step "select Insert Snippet, and select the Excel: Get cell value snippet from the list of available Office 2007 snippets."
i cant seem to get it to work when i insert snippet i dont get the excel tab anyone know y?
|
|
|
|
|
There are no Excel snippets in the ones that come with VS, I'd say they are part of the Visual Studio tools for office.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hello
Is it possible to make a reference to an appliaction that is already running
and then take control of this application in .Net ?
I was looking today at the SHDocVw.dll (internet explorer) which provides a class
that when initalised represents a collection of all the running IE instances. You
can then iterate through the collection to find the instance you want, set
an IE object equal to it and then programatically control the window.
I'm wondering now if there's a more general class that can represent all running applications.
I looked at System.Diagnostics.Process.CreateObjRef() but.....
Thank for reading
|
|
|
|
|
You can get the processes running by using
Process.GetProcesses
So you could code
For each item as process in process.getprocesses
'Do something
next
|
|
|
|
|
Hi everyone,
i need a little help. So im trying to creat an exception policy with logging without using *.config file. Im using all the classes i need like : TraceListener, TextFormatterData, EmailTraceListenerData etc., but my problem is that i dont know the steps(the algorithm) for creating a policy without the *.config file? Can somebody help me?
Thank you in advance!
|
|
|
|
|
System.Diagnostics.Debug.Listeners.Add(listener);
System.Diagnostics.Trace.Listeners.Add(listener);
|
|
|
|
|
To originSH : Thanks but i cant find the place for this code. If you dont mind see what i already wrote :
catch (SqlException ex)
{
TextFormatterData emailTextFormatterData = new TextFormatterData();
emailTextFormatterData.Name = "Text Formatter";
emailTextFormatterData.Template = "<template>
|
|
|
|
|
Does anyone know if it is possible to call a web service to return some data and after the data has been returned the web service carreis one fetching more data. So it starts a new thread that carries on after the call has been completed?
I am trying to write a web service to retrieve data from the database that can return the first page only on large data sets and then fetch the rest into cache after the call, so any subsequent pages will be fetch quickly.
|
|
|
|
|
Hi,
I have C# GUI that use managed C++ dll. the managed c++ dll calls unmanaged c++ dll. The three projects compile and link correctly.
but I have the following run time exception:
"The specified module could not be found"
Somewhat, the unmanged C++ dll could not be read. Any idea why I have such error?
Thank you.
Alam
|
|
|
|
|
Perhaps your program can't find the unmanaged dll.
|
|
|
|
|
I have a set of class all deriving from the same interface, iVendor. Now I have a user control that I am formatting according to the type of VendorClass that it will be assigned via a property. The problem is the following: My middle tier is returning a generic Collection that is returned from a generic function. So my function signature is as follows:
public static Collection<t> GetVendors<t>(eDataDetail eDetail, int Contract_ID, ref ContractsException oCEExecption,
int startRowIndex, int maximumRows, out int TotalRowCount) where T : iVendor, new()
I'm trying to assign the result of this function call to a property on my usercontrol with a signature of :
public List<ivendor> Vendors
{
get { return this._oLVendors; }set { this._oLVendors = value; }
}
I'm trying to make the assignment as follows:
ctlDemographics.Vendors = new List<ivendor>(Contract.GetVendors<contractvendor>(Contract.eDataDetail.Basic, this.ContractID, ref oCE, 1, 300, out TotRowCount));
SInce there is no such thing as Generic properties can someone explain how I would go about handling this?
Thanks
Regards, Santiago "Saint" Perez Florida's Turnpike Enterprise - Santiago.perez@dot.state.fl.us
|
|
|
|
|
Hi Santiago,
You could do this;
class MyClass<t>
{
private List<T> _list = null;
public List<T> Prop1
{
get { return _list; }
set {_list = value; }
}
or if you have a known base class or interface of the types to be stored on the List
you can do this:
public interface iInterface{}
class MyClassA:iInterface{}
class MyClassB:MyClassA{}
class MyClassC:MyClassB{}
class MyClassD
{
private List<iInterface> _list = null;
public List<iInterface> Prop1
{
get { return _list; }
set {_list = value; }
}
Andy
|
|
|
|
|
Using your example I have :
using SCG = System.Collections.Generic;
SCG.List oColl = new SCG.List();
oColl.Add(new B("Michelle"));
oColl.Add(new B("Chris"));
oColl.Add(new B("kathy"));
this.Prop = new SCG.List<iclass>(oColl);
public SCG.List<iclass> Prop
{
get { return new SCG.List<iclass>(); }
set { }
}
I get an error on line:
this.Prop = new SCG.List<iclass>(oColl);
Error is:
Error 1 The best overloaded method match for 'System.Collections.Generic.List<webapplication1.iclass>.List(int)' has some invalid arguments C:\Projects\ConsoleApplication1\WebApplication1\Default.aspx.cs 26 25 WebApplication1
Regards, Santiago "Saint" Perez Florida's Turnpike Enterprise - Santiago.perez@dot.state.fl.us
|
|
|
|
|
This error could be because of a type mismatch - but since the type used for list is not given in your examples it's impossible to tell.
Andy
|
|
|
|
|
I think I found the solution: COnvertAll method of the COllectionBase Collections.
//Collection to list
SCG.List oColl = new SCG.List();
oColl.Add(new B("Michelle"));
oColl.Add(new B("Chris"));
oColl.Add(new B("kathy"));
SCG.List<iclass> ListA = oColl.ConvertAll<iclass>(new Converter<b,iclass>(ConverttoIClass));
public static iClass ConverttoIClass(iClass obj)
{
return (obj as iClass);
}
Regards, Santiago "Saint" Perez Florida's Turnpike Enterprise - Santiago.perez@dot.state.fl.us
|
|
|
|
|
FOund the solution using PowerCollections Algorithms class:
ctlDemographics.Vendors = new List<ivendor>(Algorithms.Convert<contractvendor, ivendor="">(Contract.GetVendors<contractvendor>(Contract.eDataDetail.Basic, this.ContractID, ref oCE, 1, 300, out TotRowCount), Vendor.ConverttoiVendor));
Had to create a Convert Delegate, very simply:
public static iVendor ConverttoiVendor(iVendor oV)
{
return (oV as iVendor);
}
THen just pass that to the constructor of a new generic List<>.
Regards, Santiago "Saint" Perez Florida's Turnpike Enterprise - Santiago.perez@dot.state.fl.us
|
|
|
|
|
Hi All,
I am sure this has been answered somewhere, but I have scoured the web for a couple hours and seem to find the question being asked but never answered. My problem is simply this:
I have an LDAP query that simply pulls the groups out of Active Directory and adds them to listbox. The application works perfectly on my development box; however, when I take the application live as a website on a development server instead of groups being returned and added it only adds 1 line to the listbox, "System.byte[].
Here is what my code looks like, pretty basic directory searcher:
private void PullGroups(string DistinguishedName)
{
DirectorySearcher ds = new DirectorySearcher("mycompany's domain");
ds.PageSize = 0;
ds.SearchScope = SearchScope.Subtree;
ds.ReferralChasing = ReferralChasingOption.None;
ds.SizeLimit = 100000;
ds.Filter = "(&(objectClass=Group)(objectCategory=Group)(ManagedBy=" + DistginuishedName + "))";
SearchResultCollection src = ds.FindAll();
try
{
foreach (SearchResult searchResult in src)
{
string groupName = searchResult.Properties["sAMAccountName"][0].ToString();
lstGroups.Items.Add(groupName);
}
}
catch
{
}
}
Any help on this would be greatly appreciated. Thanks, Matt
|
|
|
|
|
It looks like the return type from the property is actually an array of bytes making up a Unicode string. Calling ToString on it will do exactly what you described as the problem. Try doing this to get the bytes converted to a string:
using System.Text
.
.
.
string acctName = Encoding.Unicode.GetString(searchResult.Properties["sAMAccountName"][0]);
|
|
|
|
|
Hi Dave, thanks for the response.
I tried the code you suggested, and it gives the errors
The best overloaded method match for 'System.Text.Encoding.GetString(byte[])' has some invalid arguments
and
cannot convert from 'object' to 'byte[]'
I am guessing that the property collection is of the object type. What perplexes me the most is that the group names are returned fine running from Visual Studio, but when I bring this to a webserver it gives me the byte array.
I'm going to continue to work with the encoding though, I think that is where the problem lies as you suggested.
|
|
|
|
|
You can cast the object to a byte array, then pass that to GetString.
|
|
|
|
|
I was able to solve this one by removing impersonation as true in the web.config and using an impersonation context only in the method which determines what user is accessing the page, then removing the context after this information is passed into the methods working with the Active Directory.
Looks like it was an authentication issue. Hope this information helps anyone who has come across this problem.
|
|
|
|
|
Hi,
I need to search for hard coded strings from the VC++ 6 / VC++.Net 2003 source code.
Is there any tool for this?
Is there any criteria to define the search for this?
Regards,
Neeranjan
Thanks & Regards,
Neeraj
|
|
|
|
|
Have you looked under the Edit menu? Perhaps "Find..." or "Quick Find..." would do what you want...
|
|
|
|
|
I would say, anything what is between two '"' is 'hardcoded' string... so search for '"'.
Or maybe I don't understand what you need
Pilo
|
|
|
|
|
Please read the forum guidelines.
______________________
stuff + cats = awesome
|
|
|
|