|
Hi,
I am just starting with .NET programming and am trying to figure out the implementation of Data Access block provided by the Microsoft Enterprise Library. How does one provide connection string and access the database using the Library?
Thanks
Minu
|
|
|
|
|
There is a configuration program installed with the library. Run the configuration program and configure the application blocks you are going to use in your program. It creates entries in the app.config or web.config, and adds another config file for your application. You put both of these files in your project. Thats it.
|
|
|
|
|
Hi!
If I have a static variable in a class in a class library, will it be shared among all programs that use the same class library on the same computer, or will every program have it's own?
public class x
{
public static int y = 0;
}
BR
Christian
|
|
|
|
|
Every instance of the class will have it's own value.
What are you trying to do?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
Oops! Hadn't had my Coke yet!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Static variables are static within their appdomains. So two appdomains within the same process can have two different values.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
It is true, but there is a way to modify such behavior.
If you mark your variable with ThreadStaticAttribute then this variable will be unique for thread.
Best regards
Sergey
|
|
|
|
|
Every program that is running on your computer has its own Process. The operating system creates the process which your program will run. Each process has its own stack and heap and depending on how many threads you are running, and the operating system every thread in your program will have its own stack. This is true no matter what DLLs are being used by your program. DLLs or shared libraries do not have their own stack or heap.
|
|
|
|
|
Does anyone know how to send an object through TCP Socket?
Or how can I convert an object to a byte array in .NET Compact Framework?
Thanks a lot!!!
|
|
|
|
|
Try .Net Remoting (look it up on msdn and there are lots of books). The object must be serilizable first so don't try to move a datatable or a hashtable.
|
|
|
|
|
But if I am using .NET Compact Framework, how can I do so? It is because there is no .NET remoting in .NET Compact Framework. Thanks a lot for your reply
|
|
|
|
|
You can use binary serialization to write the object out as a binary stream and reconstruct it at the other end.
private void Serialize(NetworkStream stream, object obj)
{
BinaryFormatter formatter = new BinaryFormatter();
formatter.Serialize(stream, obj);
}
private object Deserialize(NetworkStream stream)
{
BinaryFormatter formatter = new BinaryFormatter();
return (YourTypeHere) formatter.Deserialize(stream);
}
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
thanks so much. But there is no binary serializable class in .NET compact framework, it only available in .NET framework.
anyway, really thanks a lot!
|
|
|
|
|
How about using System.Xml.Serialization.XmlSerializer to serialize and deserialize data? Is that available in CF?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
it is not available too. But I found from some books that seems it is related to what you suggested, the Xml Web service.
Really thanks so much!!
|
|
|
|
|
Hi i using this Sample for VB.Net
http://www.freevbcode.com/AuthorInfo.asp?AuthorID=6163
I need update for Close Connections.
API is : SetTcpEntry
Declare Function SetTcpEntry Lib "IPhlpAPI" (ByRef pTcpRow As MIB_TCPROW) As Integer
Inside Command1_Click and area With TcpTableRow, inserting this code for test :
If CStr(GetTcpPortNumber(.dwRemotePort)) = "1452" Then
MsgBox("Found")
.dwState = 12
SetTcpEntry(TcpTableRow) --> BreakPoint
End If
1452 is remote port the my Laptop connected to Game Server in my PC.
I looking using Netstat -n
This Stop in BreakPoint but not Close Connection.
ny idea or Sample Code working ?
|
|
|
|
|
Any idea how to embed an exectuable inside another executable, and then from with in your program, call the embeded exectuable with out creating another process or wrting the embed exectuable to disk?
I have a C++ program (straight C++, not managed). It has some logic and then depending on a number of conditions, ShellExecute()s another exectble file (client.exe), which happens to be a .net file. Is there anyway that I can add this client.exe file as a resource of my C++ program, and then call the beginning of the code from within the C++ program, so I wouldn't have to extract the resource or create a new process
Please help
Thanks,
Jason A. Donenfeld
PS: This is what I have now:
<br />
#define WIN32_LEAN_AND_MEAN<br />
#include<br />
#include<br />
#include<br />
<br />
#define INSTANCEMESSAGE "ShowZIM"<br />
#define WINDOW_TITLE "ZX2C4InstantMessenger"<br />
#define MUTEX_STRING "Local\\ZX2C4IM"<br />
#define FILE "client.exe"<br />
<br />
int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)<br />
{<br />
if(_tcscmp(lpCmdLine,"clone"))<br />
{<br />
CreateMutex(NULL,TRUE,MUTEX_STRING);<br />
if(GetLastError()==ERROR_ALREADY_EXISTS)<br />
{<br />
SendMessage(FindWindow(NULL, WINDOW_TITLE), RegisterWindowMessage(INSTANCEMESSAGE), NULL, NULL);<br />
return 0;<br />
}<br />
}<br />
ShellExecute(NULL,NULL,FILE,lpCmdLine,NULL,SW_SHOW);<br />
return 0;<br />
}<br />
|
|
|
|
|
As far as I know, you can't do that. I don't know of any Execute method that will load a file from memory.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
I figured there might have been a round-about way to do this. I think your right though, there's no way I'd go through this kind of trouble just to embedded an .EXE.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
At one time I had 1.1 and VS.NET Eterprise architect 2003.
Due to lisencing issues I had to take 2003 off and Insatall VS.NET Eterprise architect 2002. Along with that also came Framework 1.0
Now I am stuck with 1.0 (I still have 1.1 on my box). Is there a way I can switch from 1.0 to 1.1 with out disturbing my VS.NET installation or messing up my box.
Thanks.
|
|
|
|
|
No. VS.NET 2002 will only target the .NET Framework 1.0. It won't compile against 1.1.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have a EXE for my vb.net project. I want to keep this on a server and put shorcut on client machines to launch this.
Any information regarding issues,problems, requirements will be help ful.
Thanks
|
|
|
|