|
I wasn't able to find the assembly that defines the IDispDataVwDataConn interface you mentioned to make sure it is attributed correctly, but there is the Microsoft.VSDesigner.dll assembly (in the Common7\IDE sub-directory of your VS.NET installation directory) that has the IDataConnectionsService which could accomplish the same thing.
Perhaps if you told me what the full assembly name is and where I might find it (I've looked to no avail) I might be able to help you better.
Make sure you also have referenced that assembly in your project, otherwise the interface won't be found when compiling (but I'm assuming you've done that and are having runtime problems).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Add Reference => COM => Visual Studio.NET Data Projects (DLL can be found at <path to="" vs.net2003="" dir="">\Common7\Tools\VDT\vdt70p.dll).
I also saw that interface (IDataConnectionsService) but I guess it can do no good as first one is used. If you wish to see what I mean start VS.NET => Server Explorer => expand Data Connections node => right click on any exiting one => Properties => Next to name of is type and it's IDispDataVwDataConn.
Cheers mate...
|
|
|
|
|
Since it's being imported from a typelib, it is a COM wrapper (RCW) and is an imported interface (just to be sure it was correct, I double-checked). Casting the Object property should work (and obviously doesn't). Have you tried just casting the node itself?
If anything, there is a developer forum for the VSIP (developing and integrating components with VS.NET itself) on the MSDN[^] web site somewhere. You might consider that approach.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
As said in first post I tried casting both Object and node... unsuccesfuly. Also I found extensibility newsgroup (microsoft.public.vstudio.extensibility) with same subject but no answer (guys came as close as I did). Google search => also founde one unfinished discussion. So I guess I should just quit it...?
|
|
|
|
|
how do I check if a file with a given path is read only?
|
|
|
|
|
Use =>
System.IO.File.GetAttributes(string pathToFile);
and then compare it using System.IO.FileAttributes enum...
|
|
|
|
|
But the following lines never give anything but '1'. How am I to distinguish between read-only and read/write files?
System.IO.FileAttributes att = System.IO.File.GetAttributes( this.currentFolder);
MessageBox.Show(att.CompareTo(System.IO.FileAttributes.ReadOnly)+"");
|
|
|
|
|
Bitwise conditions:
FileAttributes attribs = File.GetAttributes("file.txt");
if ((attribs & FileAttributes.ReadOnly) != 0) Console.WriteLine("Read-only");
else Console.WriteLine("Read-write");
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thank you, but now I only get 'False'. I'm changing the file's read-only attribute by hand because my program does not create or write to these files directly, but my program does need to know if the file it's dealing with is read-only or not. Any suggestions?
|
|
|
|
|
Judging by your variable name, you're trying to get attributes for a directory. Directories don't have a read-only attribute. Only their containing files do. In fact, directories don't really have many attributes at all.
Trust me, the code works. We use it a lot in our application. You might also want to take a look at the FileInfo class which provides the same information in a different way.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
your right; I grabed the wrong variable. Thank you.
|
|
|
|
|
I have a placeholder sitting on a page with a button above it. When the button is clicked, I want it to add a textbox and to the placeholder so I have the following code execute for the onclick...
<br />
TextBox temp = new TextBox();<br />
<br />
temp.TextMode = TextBoxMode.MultiLine;<br />
temp.CssClass = "txtArea";<br />
<br />
temp.ID = "txtArea" + phModNotes.Controls.Count.ToString();<br />
<br />
phModNotes.Controls.Add(temp);<br />
The expectation being that the controls will be named sequentially starting at txtArea0 and counting up. However, everytime I click the button, phModNotes gets reloaded and is empty.
|
|
|
|
|
|
Hello all.
I have encountered some difficulties while writing a program that is supposed to use memcpy. To be honest, I can't get it to work at all, and I don't have a clue what I'm doing wrong.
Here's the most important part of the code:
<br />
DllImport("msvcrt.dll")]<br />
public static extern unsafe void memcpy(void* to, void* from, int len);<br />
<br />
[StructLayout(LayoutKind.Explicit)]<br />
private struct Buffer<br />
{<br />
[FieldOffset(8)]<br />
public byte Buff0;<br />
[FieldOffset(0)]<br />
public int Length;<br />
FieldOffset(4)]<br />
public int Start;<br />
<br />
private static unsafe void CopyToBuffer(Buffer* buffer, byte* data, int len){<br />
if ((( buffer.Length + buffer.Start) + len) >= 262144)<br />
{<br />
throw new NullReferenceException(string.Format("Buffer overflow, or something"));<br />
}<br />
memcpy(((&buffer.Buff0 + buffer.Start) + buffer.Length), data, len);<br />
buffer.Length += len;<br />
}<br />
}<br />
The errors I get are
"Operator '.' cannot be applied to operand of type Buffer*".
I thought that I declared buffer.Lenght as int, so why isn't it working?
I call CopyToBuffer like:
<br />
buffx = p.Finalize();
unsafe {<br />
fixed (byte* buff= buffer1)<br />
{<br />
CopyToBuffer(m_Buffy, buff, buffx.Length);<br />
}<br />
}<br />
return;<br />
m_Buffy is declared as
<br />
private unsafe static Buffer* m_Buffy;<br />
and gets its value on runtime (the address of the recieve buffer).
It's a pretty simple thing, really. I just want to send a text message to a process through its recieve buffer.
I'm a little new to all of this, so I haven't yet fully gotten then hang of API hooking, dll injection and packet filtering and all that which migth have aided me here, but I do my best.
Any response is deeply appreciated.
|
|
|
|
|
Before using memcpy (or whatever variation you may be using), I'd strongly suggest you to take a look at Marshal.Copy method.
Yes, even I am blogging now!
|
|
|
|
|
Dear Friends
I m making Internet Club Management Software, i Want to ask 2 question's Please help me
How I can Stop / Execution of the Software ruuning on Client Machine.???
How I can Block IP/or unblock IP and banning a site on a client????
|
|
|
|
|
Your questions are rather vague. To answer your questions, Yes and Yes. Of course, the next logical question now from you would be 'How?'. If you could provide more information, especially about why exactly you are trying to do (beyond what you said above) we could help you. Do you have a specific programming question (i.e., something your stuck on)?
- Nick Parker My Blog | My Articles
|
|
|
|
|
My requirement is I need to put web service name space/ url in a properties file and invoke the corresponding web service. How can I do that ?
Here is the sample C# code which got generated with a wsdl utility using a wsdl file.
My requirement is I should read that IP addresses, Name, namesapce from a configuration file insteadof hard coding like below. Is that possible? If yes, How?
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Web.Services.WebServiceBindingAttribute(Name="MyValidationBinding", Namespace="http://33.83.76.254/")]
public class Validation : System.Web.Services.Protocols.SoapHttpClientProtocol
{
/// <remarks>
public Validation()
{
this.Url = "http://33.83.76.254:5556/soap/rpc";
}
/// <remarks>
[System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://33.83.76.254/MyValidation", ResponseNamespace="http://33.83.76.254/MyValidation")]
[return: System.Xml.Serialization.SoapElementAttribute("responseXml")]
public string myvalidate(string s1, string s2)
{
Thanks,
jcm
JCM
|
|
|
|
|
|
Thanks Nick.
But I need to build that as DLL. If I build the DLL how do I deploy the config file with the DLL. Where should we put the config file?
Also, the link talks about only in the constrcutor of the program like below
public Books() {
this.Url = ConfigurationSettings.AppSettings["WebServicesUrl"]
}
but how do we replace the name, namespace values before the method call like below
[System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://33.83.76.254/MyValidation", ResponseNamespace="http://33.83.76.254/MyValidation")]
[return: System.Xml.Serialization.SoapElementAttribute("responseXml")]
public string myvalidate(string s1, string s2)
{
Thanks,
JMC
|
|
|
|
|
The code you are looking at is simply a proxy that was generated from wsdl pointing to your web service. The proxy is what talks to the web service and returns the values to you. You can deply the config file right along with your assembly, within the same directory. The problem is that attributes must be a connstant expression, in other words you can't set thier values by an inline method call or in your case, pointing to the AppSettings to gain dynamic values at runtime. If you read through the comments in that link I sent you, Peter Cook suggest that you set the web reference to dynamic rather than static thus allowing Visual Studio .NET to handle this for you.
- Nick Parker My Blog | My Articles
|
|
|
|
|
Hi, I need to check the status of WMI services (running, stopped, or disabled) on a local computer, using System.Management classes in .NET. If anyone knows please update this.
Thank you.
Thank you
Silver Bullet
|
|
|
|
|
If WMI isn't running, you can't use WMI to check the status of itself. The best way is to use the ServiceController like so:
ServiceController sc = new ServiceController("winmgmt");
if (sc.Status != ServiceControllerStatus.Running)
sc.Start();
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I have made a report using crystal reports.net. I am using a MDB file as my datasource. When I close the form that displays my report, the report is not disconnecting from the datasource. What do I need to do to disconnect the report from it's datasource.
Thanks.
|
|
|
|
|
Use a DataSet as the data source. Fill your DataSet with what you need from the Jet database (MDB) and pass it to SetDataSource . In the Cyrstal Reports designer, you can bind against a DataSet but it helps to use a typed DataSet , which xsd.exe or the DataSet designer in VS.NET can do easily.
If you have a view, table, or tables that you want to fill the DataSet with, connect the Jet database in the Server Explorer, browse to the view or table(s), and drag and drop them into a new DataSet item you can add to your project. This will create the necessary elements for you.
Then in the Crystal Reports designer, you can add a reference to that typed DataSet and design your report as you would normally.
This makes for a good disconnected architecture since it doesn't matter from where that data is obtained (could be a Jet database, SQL Server, Oracle, an XML file, etc.).
Microsoft MVP, Visual C#
My Articles
|
|
|
|