|
john34 wrote: Any Ideas ?
What are you trying to do? Is this some sort of plug-in solution?
|
|
|
|
|
Is there any significance to the use of the @ in a variable name (like @intx)?
Thanks.
|
|
|
|
|
The @ symbol is usually used for SQL Server parameters
SqlCommand.Parameters["@ID"].Value = 1234;<br />
<br />
CREATE PROC sp_MyProc @ID INT <br />
AS<br />
SELECT * FROM Table WHERE ID = @ID
The at symbol is also used to escape string literals
string path = @"C:\Program Files\Some Folder";
only two letters away from being an asset
|
|
|
|
|
sa_runner wrote: Is there any significance to the use of the @ in a variable name (like @intx)?
Using @ means that you can have a variable name that (sort of) matches a type name, e.g. object @object. In your code you can then refer to @object. It really doesn't seem to be good practice to me.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
In SQL yes, in C# no.
You can use it in c# as well, but the only thing that happens is that Intellisense does not work on this variable
-^-^-^-^-^-
no risk no funk ................... please vote ------>
|
|
|
|
|
@ is used to specify an identifier. It's mostly used to access members of third party classes that happen to be keywords in C#.
Example:
SomeComponent.@int x = new SomeComponent.@int();
---
single minded; short sighted; long gone;
|
|
|
|
|
Interesting, learn something all the time. Can't say as I've every seen this in use, and can't think of a reason why.
only two letters away from being an asset
|
|
|
|
|
reserved words are different in different languages. It's needed to allow assemblies written in Foo.net to always work in Bar.net without requiring any changes to the Foo.net source code because the author used a variable name that's reserved in Bar.net. MS tries to avoid any situation like this for the languages they officially provide (I've never actually seen it used myself), but the more languages supported the harder it becomes, and 3rd parties don't always have the same degree of foresight into cross language issues. This is an officially sanctioned work around.
--
If you view money as inherently evil, I view it as my duty to assist in making you more virtuous.
|
|
|
|
|
That explains it, thanks.
only two letters away from being an asset
|
|
|
|
|
I appreciate all the answers. Thanks.
|
|
|
|
|
Hello Everyone,
I am a newbie to c# and have come from a very basic c/c++/perl background. I have a question as to how to set up an odbc connection in c# .net
Setting up the connection and doing what i have to do is no prob.
The problem lies when I want to define the connection from form1 (main form) or a public static class and use that connection for all child forms.
I wanted to give the connection a global scope, since it will be the only connection in my program. I tried defining it in a static class and setting each form's odbccommand.connection to equal the connection in the static class.
public class GlobalDB
{
public static OdbcConnection GDB;
static GlobalDB()
{
GDB.ConnectionString = "DRIVER={MySQL};SERVER=localhost;PORT=1111;DATABASE=test;UID=test;PWD=test";
}
}
From form 2:
this.SelectodbcCommand.Connection = GlobalDBNS.GlobalDB.GDB; //this.odbcConnection1; <<--- when called from local form all is good!
setting the connection = to my Global DB throws an exception I cannot catch.
Is this approach anywhere close to correct?
Should I just pass the connection to each of the child form's constructors?
Thanks in advance,
WT
PS what is the best book on c#.net out there? I want to get up to speed rather quickly.
|
|
|
|
|
You need to instantiate your GlobalDB class (just once!) somewhere before the first use of it. Without that the "global" connection won't exist.
Phil
The opinions expressed in this post are not necessarily those of the author, especially if you find them impolite, inaccurate or inflammatory.
|
|
|
|
|
Hi,
If anybody knows how to load up a Page object form a web address or has any idea about what could be done, please drop a message, even if you don't whant to...
Thx
|
|
|
|
|
What you are asking for is nothing that is normally done. What is it that you are trying to accomplish?
---
single minded; short sighted; long gone;
|
|
|
|
|
I have to extaract data by crawling true a website. I have to somehow get a Page class so I can access Page.Controls collection.
If I'm right, I have a hunch, with HttpWebRwsponse this could be done... still, I din't found a way yet...
|
|
|
|
|
You can only possibly create a Page object for a page if the page is in the same web application. If it's not, you can't.
The HttpWebRequest gets a response from which you can get the html code for the page as a string. The code contains only the html code that is generated, but no information about what server controls was used to generate the code, so you can't recreate any server controls from the response. You have to parse the html code to get the data from the page.
---
single minded; short sighted; long gone;
|
|
|
|
|
Thx for the response, it makes total sens... I hope I can make this somehow work , this tool will be used to trak down bugs by gathering CSS data...
Regards, Mogyi
|
|
|
|
|
Hi,
Can anybody help me how to make a internet dilaer application to connect to the internet?I have gone through some stuff in the net bt i am completely new to this domain.And also need some info abt RasDilaer?
Any help will be appriciated
|
|
|
|
|
Hello ,
Can someone tell me how to send a SOAP resquest and receive a SOAP response.
|
|
|
|
|
Create a WebService project. Mark a method with the attribute WebMethod and compile the project up (having written some code). Import a web reference into your current project. Create an instance of the web service in your code call the web method. It's all taken care of for you.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
no.no I am asking about SOAP enabled webservice ..i.e we have to post the SOAP request manually and get the response back as a xml.
|
|
|
|
|
Hi
I have an application and I want to keep only one instance running, so I use Mutex class. All works fine until I want to restart that application immediately. It looks that Mutex is not released synchronously with ReleaseMutex() call , but a little while later. My app code looks like :
static void Main()
{
Acquire Mutex
Run main form
Release Mutex
Restart same application using Process.Start(...);
}
When restarting application immediately, Mutex is still owned by old instance, which could not happen id all was synchronized probably...
Question:
How can I wait for the Mutex to be released for sure?
(maybe Thread.Sleep(1000) for a second after Releas call...) ?
thanx for answer
zilo
|
|
|
|
|
I was not able to reproduce your problem. Perhaps you have more than one count on the Mutex?
|
|
|
|
|
I have only one mutex. I've temporary "solved" the problem by sleeping 1000 mls before (re)starting same process (to let Mutex time to Releas )
|
|
|
|
|
Zilo(svk) wrote: I have only one mutex.
Yes I know but you may have a count on it greater than ONE.
Zilo(svk) wrote: I've temporary "solved" the problem by sleeping 1000 mls before (re)starting same process
I did not need to sleep. I suspect you have a bug in your code.
|
|
|
|