|
;?xml version="1.0" encoding="utf-8"?>
<dataConfiguration>
<xmlSerializerSection type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
<enterpriseLibrary.databaseSettings xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" defaultInstance="Database Instance" xmlns="http://www.microsoft.com/practices/enterpriselibrary/08-31-2004/data">
<databaseTypes>
<databaseType name="Sql Server" type="Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase, Microsoft.Practices.EnterpriseLibrary.Data, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
</databaseTypes>
<instances>
<instance name="Database Instance" type="Sql Server" connectionString="Server=awsqlt25vs01;Database=SW2_phone_interview;Integrated Security=true;" />
</instances>
<connectionStrings>
<connectionString name="Server=awsqlt25vs01;Database=SW2_phone_interview;Integrated Security=true;">
<parameters>
<parameter name="database" value="SW2_phone_interview" isSensitive="false" />
<parameter name="Integrated Security" value="true" isSensitive="false" />
<parameter name="server" value="awsqlt25vs01" isSensitive="false" />
</parameters>
</connectionString>
</connectionStrings>
</enterpriseLibrary.databaseSettings>
</xmlSerializerSection>
</dataConfiguration>
I have the above code snippet in my windows application. Now in some methods I am getting tome out exception. So I need to add one more instance for Microsoft.Practices.EnterpriseLibrary.Data.SQL.SQLCommandWrapper to set the connection time out property for a constant value in config file
Please advise
Thanks in advance.
-
|
|
|
|
|
Hi,
I have written a stored procedure in which some insert and update statements are there. This SP i'm running in my local PC and inserting & updating some tables from remote sql server to my local sqlserver.
Now the problem is that this SP is taking too much time to execute, app. 5-7 min.
Now plz advice me some optmize solution for this.
Thanx...
krishna veer singh
|
|
|
|
|
There's far too little information here for anybody to offer you reasonable help. If I were you, I'd look to run a SQL profiler on the stored procedure and analyze the results from this. This will tell you where your holdups are.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Colleagues,
I would like to populate WPF DataGrid with data that my program generates on the fly and without a database or a file. Could you suggest me how to do it?
Tips, hints, references, insight are all appreciated!
Cheers,
- Nick
|
|
|
|
|
Create a business model and populate it into an ObservableCollection. That's the most basic thing I can think of for you. There are plenty of tutorials around that demonstrate how to do this.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
I am in the middle of creating a program for people that play pen-and-paper RPGs to roll dice on their computer (like this program), but utilizes a server/client based-IM portion to send the die roll results to all the clients and I am going to modify the following code as given here: http://www.devx.com/dotnet/Article/28253/0/page/2 to do that.
As this is my first time creating a program that utilizes anything having to do with sockets, I have a couple of questions that I have yet to find an answer about on Google, various programming sites, or other forums. Here are my questions:
- The server will not be static, as in not always on the same LAN and with the same IP address. I intend for the person acting as the server to be able to start the server and act as the server on any LAN they happen to be attached to. How do I get the server to broadcast its IP/HOSTNAME so that clients can attach to it without the person who is acting as the server having to give the others the information to log in. For example, the person starting the server may be on a LAN with a network address of 192.168.xxx.xxx and another time on one that has an address of 10.1.xxx.xxx.
- That leads to the next question. How do I get the clients to detect the server? If there happens to be more than one "server" on the network (i.e., large gaming conventions and the like), I would like for the person trying to connect to be able to detect all of them and choose the correct one. Sort of like the person starting the server to give it a name like "[b][i]Big Al's Gaming Group[/i][/b]", not just using the Host Name of the computer.
- Just for the sake of my curiosity and knowledge, and I probably know the answer to this and have a way to send the rolls to the clients already, but can you send different datatypes other than strings over the connection and have them arrive as the same datatype? I currently have the rolls going into an arraylist to be displayed in a listview control, and would love the arraylist to be sent over the connection.
I have all but this portion of the program coded and operational.
Mike Rainey
--------------------------------
|
|
|
|
|
- IMO, server need not broadcast it's details. Just start the server and listen on a specific port. Also server should prompt to enter a name for it. This name will be send to clients for displaying. Make sure all your clients know the port which server is using.
- When each client is starting, it should send a message asking for the server to provide details. UDP is the appropriate protocol for broadcasting such kind of messages. .NET framework has a UdpClient[^] class which can be useful. Your client will broadcast a message something like SERVER_DETAILS. The server program should be able to grab this message and send the servers IP, name and other required details. Receive this details on the client and show the details.
- Data will be send as bytes always. You need a wrapper to convert the bytes to appropriate data type. There are open-source initiatives like protocol buffers[^] which will allow to send messages by providing type safety. But in reality, for a highly scalable application, designing your own message protocol works well.
Array list can be send after serializing it to bytes. Read about BinaryFormater class.
raineym wrote: I am going to modify the following code as given here: http://www.devx.com/dotnet/Article/28253/0/page/2 to do that.
That is too naive way of doing a scalable networking application. You should work with Sockets directly rather than with wrapper classes like TcpListener or TcpClient . I suggest this[^] MSDN article.
|
|
|
|
|
I want to get the label position of the listview,i want to avoid that position when mouse hover event is raised ..pls help me..
|
|
|
|
|
I have two windows forms and I need to get the changing mouse position at the same time in the next form. I am using a function in the mouse move event ,so how should i properly do that..pls help me
|
|
|
|
|
you only get the mouse position by overriding the MouseMove event and only if the Form has the focus!
there could by only one MousePosition at system, never saw two mouse cursors at one screen
to get the current mouse position use GetMousePosition from win32 api or set a gobal mouse hook to retrieve the current position of the mouse if your form is not focused.
hope i could help
|
|
|
|
|
Also: Control.MousePosition gives the mouse position (in screen coordinates) any time you call it.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
thats right didn't mind and never used till now
|
|
|
|
|
Hi,
I have made (or making) a program that features a lot of mini videos. I would like to put the program on a disc and be a able to play the program on ANY windows pc.
However i don't know what the code is to retrieve the drive information which the disc would be in. e.g on computer A the disc might be in drive "D" and on computer B it might be in drive "F"..........
I am a beginner ish programmer, and if anybody could help me that would be very kind and am using vb.net
Many thanks
Dan
|
|
|
|
|
One way to get the information you need is to use the WMI classes in .Net.
It is too complicated to give detailed information in a forum like this but if you google on vb.net wmi disk information you will get lots of relevent hits.
There are other ways, but this is the most comprehensive.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
thanks for the quick reply!!!
I want the program to find the drive automatically, the wmi disk information on google seem to be a form with all the information on it. I don't really want to do that.
i found some information which you might be able to turn around and point me in the right direction.
code
for each curDrive as IO.DriveInfo in My.Computer.FileSystems.Drives
'this bit i want to do something like
if curDrive.name = c then lblDriveName = "C:\" ' i can then add it to the links later on.
is this possible or do i use the wmi way??
many thanks
Dan
|
|
|
|
|
|
Apart from WMI, there is no managed code only solution to this. However you could use P/Invoke technology to call a native function inside kernel32.dll; in C# it would look somewhat like this:
using System.Runtime.InteropServices;
[DllImport("kernel32.dll")]
public static extern int GetDriveType(string rootPathName);
public void CheckAllDrives()
foreach(string deviceLetter in Environment.GetLogicalDrives()) {
if (GetDriveType(deviceLetter)==5) Console.WriteLine(deviceLetter+" is a CD or DVD drive");
}
}
and in VB.NET it would resemble this (not tested):
Imports System.Runtime.InteropServices
Declare Shared int GetDriveType Lib "kernel32.dll" (ByVal rootPathName As String)
public Sub CheckAllDrives()
For Each(deviceLetter as String in Environment.GetLogicalDrives())
if (GetDriveType(deviceLetter) = 5) Console.WriteLine(deviceLetter & " is a CD or DVD drive");
Next
End Sub
BTW: there might be multiple CD/DVD drives in a system.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
modified on Sunday, October 11, 2009 12:18 PM
|
|
|
|
|
|
Hi Alan
Thanks for the quick reply!!!
I am a bit of a noob programmer so please excuse me
how would i incorporate what you said above?
The videos i have got have got a url of C:\............
which i would change to drive & ..............
i just tried a new form with 1 button and a label how would i use your code to display the drive
I am probably being rather thick so please excuse me
Many thanks
Dan
|
|
|
|
|
Hi,
I'm not clear what you are asking here. The methods I pointed to all return strings which can be manipulated to extract the drive letter.
e.g. if Application.StartupPath returns
c:\projects\Test\bin\debug
then Path.GetPathRoot(Application.StartupPath) would give
c:\
and Application.StartupPath(0) gets the first character from the string, i.e. 'c' which is the drive letter.
Alan.
|
|
|
|
|
Hi there
Wondering generally how the server side of an application server is done (non web based).
Say you wanted to write an accounting program. The server would run on Windows Server 2008 for example and handle business logic and database access. The client program would have the client forms, etc and obtain data from the server.
Is the server software usually set up as a Windows service normally? It would listen on certain ports?
How does the server handle multiple concurrent users? I would imagine that after authentication, some sort of thread is created to listen for requests from the user?
|
|
|
|
|
Ryan Minor wrote: Say you wanted to write an accounting program. The server would run on Windows Server 2008 for example and handle business logic and database access. The client program would have the client forms, etc and obtain data from the server.
I'd try to check if a database-server would suffice
Ryan Minor wrote: Is the server software usually set up as a Windows service normally?
Yup, that way it starts when the machine starts, without the Admin even having to log in.
Ryan Minor wrote: It would listen on certain ports?
Any free port will do.
Ryan Minor wrote: How does the server handle multiple concurrent users? I would imagine that after authentication, some sort of thread is created to listen for requests from the user?
Preferably by spawning a thread for each new connection. There's an example on MSDN on using sockets, with the server example here[^] and the client example here[^].
I are Troll
|
|
|
|
|
Hi Guys.
I'm writing a application. I need the the .NET Framework version. How to get version information?
Thanks.
|
|
|
|
|
cerembeyazit wrote: I'm writing a application.
Then you choose the version of the framework you are targeting.
only two letters away from being an asset
|
|
|
|
|
Hi,
your app can detect some version numbers; one of them through Environment.Version
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|