|
Well...VB6 also has a "static" modifier that works the same way as C++...i don't know if VB.NET still has it...but it should be quite simple to implement in C# and yet Microsoft doesn't do it...another one is the With block which is in VB but not in C#...how irritating
|
|
|
|
|
Jonathan Tan wrote:
another one is the With block which is in VB but not in C#...how irritating
I agree with that. Would have been nice. I am just glad they put in "Using" to shorten all those referrence calls!
Rocky Moore
|
|
|
|
|
I don't really care either way, but the with statement is addressed here.
Andy Gaskell, MCSD MCDBA
|
|
|
|
|
Hi all,
Does anyone how to bring up the DataLink Properties Dialog for editing a connection string, like under the properties of a OleDbConnection?
Thanx in advance
READ MSDN
|
|
|
|
|
leppie wrote:
Does anyone how to bring up the DataLink Properties Dialog for editing a connection string, like under the properties of a OleDbConnection?
Not quite sure what you are asking. If you just want to modify the connection in a Wizard form, you can righ click on the connection you used in the Server Explorer and select Modify Connection.
Rocky Moore
|
|
|
|
|
Code:
MSDASC.DataLinks dl = new MSDASC.DataLinks();
dl.PromptNew();
You can find the whole information on msdn : http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsqlmag2k/html/LinkAPI.asp
In C# project, you should add a com reference named : Microsoft OLE DB Service Component 1.0 Type Library
Good luck!
I'm amumu, and you?
|
|
|
|
|
Thx , exactly what I need, but how does one "cast" the returned object to an OleDbConnection? or a ConnectionString?
I presume I will need to implement a UITypeEditor as well as I need to show the property through a property grid.
READ MSDN
|
|
|
|
|
MSDASC.DataLinks dl = new MSDASC.DataLinks();
ADODB.Connection connection = dl.PromptNew() as ADODB.Connection;
if( null != connection )
MessageBox.Show( connection.ConnectionString );
You should add reference "Microsoft OLE DB Service Component 1.0 Type Library" and the "Microsoft ActiveX Data Objects 2.5 Library" to your project's reference.
I'm amumu, and you?
|
|
|
|
|
Hi and thx
qf0421 wrote:
MSDASC.DataLinks dl = new MSDASC.DataLinks();
ADODB.Connection connection = dl.PromptNew() as ADODB.Connection;
then as I'm using OleDb:
OldDbConnection conn = new OleDbConnection(connection.ConnectionString); ?
Cant test now but it should work. It just seems a bit over the top for such a "small" thing.
Another question, if you want to run this on another machine, do u need to register both dll's on the other PC or is the Interop.*.dll files ok for that?
READ MSDN
|
|
|
|
|
I think all dlls you refered are running at local machine, and two support remoting: web service and system.remoting, right? I'm not sure about it.
And also you can notice if you add a reference, vs.net will copy the file to your bin directory, does it means dll will be invoked local?
I'm amumu, and you?
|
|
|
|
|
How do i read one byte at a time from a remote file, i.e. a file from the web, then write each byte into a local file?
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
public static string RetrievePage(string url)
{
// Creates an HttpWebRequest with the specified URL.
HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create(url);
// Sends the HttpWebRequest and waits for the response.
HttpWebResponse myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse();
// Gets the stream associated with the response.
Stream receiveStream = myHttpWebResponse.GetResponseStream();
Encoding encode = System.Text.Encoding.GetEncoding("utf-8");
// Pipes the stream to a higher level stream reader with the required encoding format.
StreamReader readStream = new StreamReader( receiveStream, encode );
string retString = readStream.ReadToEnd();
myHttpWebResponse.Close();
return retString;
}
This function takes a URL as a string and the retrieves that URL. It shouldn't be difficult to modify this to make it work with binary (in fact I think it should work with no mods, but I can't be sure...).
Later,
Nathan
---------------------------
Hmmm... what's a signature?
|
|
|
|
|
|
Manners kiddie, manners!
Big Bro is watching you
|
|
|
|
|
Is there anyone out there who knows how to bring Rich Text to a place other than in the windows controls? I need to be able to print RTF (rich text format) to paper, and I have no earthly idea how. Does anyone have any ideas at all? Thanks in advance
|
|
|
|
|
You can view some sample Printing Documentation here
You can also view some sample code from the SDK that uses a RichTextBox and prints the text from it.
Hope that helps!
--ChrisKo
|
|
|
|
|
I am not so fortunate as to have VS.NET yet so I make do with SharpDevelop. However most of you have VS.NET and release your apps as VS.NET projects.
I am trying to get a reference to Shell32 in my SD project. The reference is originally in the FTP client project in the C# section of CP.
The code has this:
private Shell32.Shell m_Shell;
Of course a compile error has appeared saying "What the hell is Shell32?". By examining the XML of the VS.NET project I can see that it references Shell32 as a GUID:
<Reference
Name = "Shell32"
Guid = "{50A7E9B0-70EF-11D1-B75A-00A0C90564FE}"
VersionMajor = "1"
VersionMinor = "0"
Lcid = "0"
WrapperTool = "tlbimp"
/>
How can I import this into SharpDevelop?
The Internet, whats that? Is it a car?
"There's a statistical theory that if you gave millions of monkeys typewriters and set them to work, they'd eventually come up with the complete works of Shakespere. Thanks to the Internet, we know this isn't true."
|
|
|
|
|
I need to do a comparison of two dynamic numbers - say 150 and 225. How can I figure out the percentage difference (in this case, 50%) between these two numbers in ASP.Net?
Thanks.
|
|
|
|
|
like (float - float2 ) / float2
READ MSDN
|
|
|
|
|
I finally downloaded the .NET SDK to do some experimentation with it. Unfortunately an upgrade to Visual Studio.NET is out of the question at the moment, so I decided to look for a nicer way to build my experiments than .bats or makefiles. I'd heard a bit about ANT, a java based build tool, but I happened to spot another one... based on ANT... NANT. A .NET version of the ANT tool.
After getting it from http://nant.sourceforge.net I've had a bit of a play. Very nice! The build files are in XML, and seem a bit more straight forward than the old makefiles. They also claim that certain failures with makefiles are resolved by ANT/NANT. I've still got a lot of experimentation to go with it, but it looks very positive at the moment.
Anyway, thought I'd share this with you guys in case you hadn't heard of it before. Cheers.
|
|
|
|
|
Thx man , you read my mind, was on my way there
READ MSDN
|
|
|
|
|
Hi! I need to be able to view web pages in a C# application. Does anyone know how to use the IE or Mozilla engine in .NET?
|
|
|
|
|
You'll have to use COM Interop and load up the MS COM-Based HTML engine. I dont know of a native HTML parser for C# yet.
|
|
|
|
|
I want to use the DateTimePicker Control, but on language change the control should show in appropriate language? Example on French it changes the date format into french. I try to use the Globalization way but it didn't work, is any C# Guru help me out in this. I will be thankful.
|
|
|
|
|
Hey all, I'm trying to make a project that builds a directory of files so that a user can burn them to CD. One of the requirements is that I have to have an autorun file that starts up an HTML file in IE. I don't know if this is the right place...but I thought I'd ask here first.
David Stone
dstone@newcenturytitle.com
Procrastination is like masturbation; it's all good until you realize you just screwed yourself.
-Writing on a bench at college
|
|
|
|