|
Yes, I already check it. I know, var decleration and normal variable decleration is same for compiler. Compiler determine variable type at the same time which is var and normal variable decleration. But main question is var type is related about MS Aspect Oriented Programming. Why microsoft create var type? Okay, I know using in SQL Integration, and accually using for O/RM. Is it related about MS Aspect Oriented Programming or not?
|
|
|
|
|
dataminers wrote: Is it related about MS Aspect Oriented Programming or not?
I've already answered this. No it's not. They created the var type because they needed something to tell the compiler that this was an implicitly typed local variable. All it does is tell the compiler to infer the type of the variable from the declaration, which is why you can do this:
var i = 10;
Console.WriteLine("Type of i is {0)", i.GetType().Name); and not this:
var i = null;
i = 10; The second fails because the compiler can't determine the type from null.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Oh god... typeless variables... May as well code in freakin' basic.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: typeless variables
They're not exactly typeless. They are still strongly typed at compile time and run time, it's just that you're letting the compiler infer the type based on the content. It's not the same thing as the VB Variant .
|
|
|
|
|
Yes, thank heavens! Shudder.
It was entertaining to hear the shocked gasps ripple through all the old men that didn't understand 'var' when it was 'introduced' to them for the first time in June 2007. If you hadn't heard of 'var' by June, you aren't enough of a language expert to complain about it.
|
|
|
|
|
I am using NET1.1 for developing.
Generaly I install NET1.1 && NDP1.1sp1-KB867460-X86.exe SP1.
All was fine.
But today I found interesting thing
My old program is not working.
It was very stange because I know that my program worked right two months ago.
(problem with standart picturebox control !!!)
I have deployed my program at new machine with WinXPSP2 installed without updates
and found that program works fine here.
So I think that problem in last updates.
What did happen with my machine?
Witch updated did influenced at picture box control?
I think that updates have been installed during last two-three months.
PS.
I use picture properties box from another thread via Invoke.
and modify only visible property. Picturebox contains gif - animated image.
|
|
|
|
|
You can always find out what updates affected a particular technology by searching at http://www.microsoft.com/technet/security/current.aspx[^]. From this you can see that there was an update in July (MS07-040[^]).
In addition to the security issues addressed, numerous outstanding issues in the CLR were addressed that had previously been released as private hotfixes. It's possible that you've encountered one of these.
I would confirm that it's definitely this update that's caused the problem, then if this is confirmed, post the code that seems to be having the problem, or contact Microsoft. They do say that security update support is free, but this may be a slightly grey area since it's developer support.
DoEvents : Generating unexpected recursion since 1991
|
|
|
|
|
Hi Mike!
Thanks for your reply.
I have solved my problem and have written own control instead of picturebox.
I have tested my program under NET2.0 (originaly writed under 1.1)
<startup>
<supportedruntime version="v2.0.50727">
<supportedruntime version="v1.1.4322">
Added to app.config
I think that reason of this problem not in NET Updates,
but Windows Updates affected at program.
|
|
|
|
|
Mike Dimmick wrote: (MS07-040[^]).
The list is scary with so much of patches to eat away the disk space. Considering all these, would MSDOS-based BATCH file based development be better or more RAD-friendly?
|
|
|
|
|
Using VS2005 SP1 on a WinXP Pro machine, using C++/CLI. The behavior described below does NOT happen when I replicate my steps using C#...
I'm trying to create a parent form class "FParent" so that I don't have to keep recreating controls common to each of the child forms. The child controls need to be contained in a Panel control, which I would also prefer to set in the parent form so that I don't have to keep re-creating the container panel.
When I create the child form "FChild", I go into the code view and change the class declaration from "public ref class FChild : public System::Windows::Forms::Form" to "public ref class FChild : public FParent".
At first, I could not drag a control into the parent panel area. However, if I go into the parent code and make "panel1" PROTECTED instead of PRIVATE, now it lets me drag a control.
So then I tried to drag a button onto the panel, and in FChild code I could see the line: "panel1->Controls->Add(button1)". This is exactly what I want. HOWEVER, when I close the designers, rebuild the project, and reopen the designers, the child button no longer renders properly. Instead of rendering as a child of the panel, the control is relative to the FChild client. In other words, if I had dropped a button at Point (3, 3) into the panel which was located at Point(20, 20), the button gets rendered at client point (3, 3) instead of the desired Point(23, 23). To make things worse, if the parent panel overlaps the child control, the parent panel is rendered over the top of the child control.
Does anyone know how to get around this and make the control render as a child of the parent panel, or do I need to compromise and make the container panel a member of FChild instead of FParent?
Thanks for your help.
|
|
|
|
|
If you have been looking forward to a way to combine WinForm controls within a Windows Presentation Foundation (WPF) client, Glen Block has announced the Windows Presentation Composite Client in his blog, My Technobabble. The WPF Composite Client is a project of the patterns & practices team. While the project is similar to Composite Application Block (CAB), the WPF Composite Client is a new set of libraries and guidance.
The team is incorporating lessons learned around patterns such as Modularity (composition), services, dependency injection, event brokering. and others.
The plan is to create a set of deliverables to be shipped piecemeal rather than just one giant “factory” release. Look for everything to ship before the end of 2008.
As for Acropolis, the team has announced the core Acropolis concepts will be rolled into future .NET Framework releases and into Silverlight. In her blog posting A new phase for the Acropolis project Kathy Kam advises:
If you have evaluated Acropolis and are unsure whether to adopt it for your project, or to use the existing CAB, or to wait for the new guidance, our guidance for this situation remains the same - if you are building a Windows Forms LOB (line of business) composite client (with maybe rich islands of WPF content) you should carefully evaluate the current CAB release. If you are specifically interesting in building composite applications on .NET 3.5, please get involved with the Patterns & Practices project and help us to deliver a guidance package that meets your requirements.
|
|
|
|
|
When you run a Console Application, in a console by pushing f5.
How do you get the console to pause, I would like to get to pause so I can look at my work.
You can cut this and play with it if you like. I just wont to pause it.
what should I Dim to pause or add to the end of the code?
This is a Application Domain.....Demo
Module Module1
Dim d As AppDomain = AppDomain.CreateDomain("NewDomain")
Sub Main()
Console.WriteLine("Host domain: " + AppDomain.CurrentDomain.FriendlyName)
Console.WriteLine("Child domain: " + d.FriendlyName)
End Sub
End Module
-- modified at 12:41 Tuesday 30th October, 2007
tim637
|
|
|
|
|
|
Thanks that was a good input.
tim637
|
|
|
|
|
Add a Console.ReadKey() before the End Sub . This tells the program to wait for input from the keyboard.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thanks that was a good in put.
tim637
|
|
|
|
|
I created a new web site project, and added a database to it. How do I setup a user id and password to access the specific database? I tried to "modify connection" but it said something about the username is not associated with a trusted SQL server connection.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Do you mean a username and password to access the SQL database through that rather than Windows Integrated Security (or whatever it's called), i.e. you specify the username and password to connect to the database?
If you're trying to connect through integrated security from ASP.NET chances are that that role has not been added to the permissions on the database. I.e. you need to create a user (server wide) for ASP.NET and then allow this user permission to read/write to the database in question.
A similar thing is required if you're using SQL Authentication rather than Integrated.
Of couse I may have misunderstood you completely.
|
|
|
|
|
The user Id/password that you use in the connection string relate to a user that is set up in the database. You would need to add a particular user to the database and set it up with the relevant permissions.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
What would cause SelectSingleNode to not retrieve the specified node?
I tried this:
XmlNode groupNode = root.SelectSingleNode("connectionStrings")
(root is "configuration").
I also tried this:
XmlNamespaceManager nm = new XmlNamespaceManager(doc.NameTable);
nm.AddNamespace("br", "C:\\web.config");
XmlNode groupNode = root.SelectSingleNode("//br:"+m_groupName, nm);
I always get a null response from SelectSingleNode, even though the section I'm looking for is really in the file.
Anyone?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Can you post the relevant snippet of your xml file?
|
|
|
|
|
It's a "typical" web.config file generated completely within the VS2005 IDE.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Ok, I think I might have got something working for you:
Xml File:
<?xml version="1.0"?>
<configuration xmlns:br="http://microsoft.com/schemas/VisualStudio/TeamTest/2006">
<br:connectionStrings>
<add name="SQL" connectionString="SQL" />
</br:connectionStrings>
<connectionStrings>
<add name="SQL2" connectionString="SQL2" />
</connectionStrings>
</configuration>
Code:
using System;
using System.Xml;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
XmlDocument dom = new XmlDocument();
XmlNamespaceManager manager = new XmlNamespaceManager(dom.NameTable);
manager.AddNamespace("br", "http://microsoft.com/schemas/VisualStudio/TeamTest/2006");
dom.Load("Web.config");
XmlNode groupNode = dom.DocumentElement.SelectSingleNode("br:connectionStrings", manager);
if (groupNode == null)
Console.WriteLine("(null)");
else
Console.WriteLine(groupNode["add"].Attributes["name"].Value);
}
}
}
Basically you need to construct the XmlNamespaceManager like you did but pass it into the SelectSingleNode function so that the function can use that object to resolve the namespaces in the XPath query.
Hope that helps, MS probably have their reasons for implementing it this way but it does seem a bit backwards, surely the NameTable should be populated from the xml file if that's where you read it from.
|
|
|
|
|
Thanks, I'll look at that when I get to work.
I initially tested my app with a simple web.config file. This file has your typical configuration section with a appSettings, connectionStrings, and a web.config section. That was working pretty well, so I decided to try it with one of our production web.config files (significantly larger and more complex). This file has the same stuff as the other one, as well as a configOptions section. A significant difference between the two files is that the production one has comments.
I'm trying to use Alvaro Mendez's read/write XML article [^] as a stepping off point because I haven't found ANY class that can handle the entire web.config file (none of them can read the connectionStrings section). His article doesn't do the namespace thing (and doesn't read the connectionStrings section), and seems to work fine on my small file, but chokes/pukes on the "real" config file.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
What I'm wondering is if this is a "standard" web.config why do you need namespaces?
|
|
|
|