|
.NET will first look if an Assembly with the same version number is in the GAC, then it falls back to the working executable's directory
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
It also looks in the private path, which can be configured in the application's .config file using the <probing> element (see SDK documentation for details).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Well, I did plugin loading by first just listing all the DLL files in the plugins directory and then calling Assembly.Load() (I think that's what it was called) for each of them and specifying the file as the parameter.
|
|
|
|
|
Hello
I am creating a database which will be used to display information and pictures for houses. I have done everything but be able to insert the pictures and retrieve them from the database.
This is the code l am using to make the connection with the database
//Example Connection
m_cnADONetConnection.ConnectionString = @"Provider=Microsoft.jet.OLEDB.4.0;data source=C:\Houses";
m_daDataAdapter = new OleDbDataAdapter("Select * From Houses",m_cnADONetConnection);
OleDbCommandBuilder m_cbCommandBuilder = new OleDbCommandBuilder(m_daAdapter);
m_daDataAdapeter.Fill(m_dtContacts);
//This is what i am using to retrieve from the database, not sure how to do this for a image control.
txtHouseID.text = Rows[rowPosition]["HouseID"].ToString();
To select the picture l want to add to the database, l am using a open dialog box, which works, but l can't add it to the database.
Many thanks in advance
Steve
|
|
|
|
|
First, learn to use OleDbParameter . This will greatly aide in your problems. Second, set the column in which you want to store the image to an OLEObject.
Then, you need to be able to read the image from a Stream as a byte[] array and assign it:
OleDbCommand cmd = conn.CreateCommand();
cmd.CommandText = "INSERT INTO SomeTable (Name, Image) " +
"VALUES (@Name, @Image)";
cmd.Parameters.Add("@Name", OleDbType.VarWChar, 40).Value = "ImageName";
cmd.Parameters.Add("@Image", OleDbType.Binary).Value = image;
cmd.ExecuteNonQuery();
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Thanks for your help
I was starting to read up on the stream. Could you give me a example how to read the image from a stream as a byte data.
I am interested in using the parameters more, as it seems to be very useful. Is there any good tutorial on them.
Many thanks in advance
Steve
|
|
|
|
|
There's the .NET Framework SDK documentation - just type OleDbParameter in the index.
There's probably tutorials on this site and around the 'net, but they're not hard to use and the documentation offers plenty of information and examples.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
The OLE DB .NET Provider does not support named parameters for passing parameters to a SQL Statement or a stored procedure called by an OleDbCommand when CommandType is set to Text. In this case, the question mark (?) placeholder must be used. For example:
SELECT * FROM Customers WHERE CustomerID = ?
As a result, the order in which OleDbParameter objects are added to the OleDbParameterCollection must directly correspond to the position of the question mark placeholder for the parameter.
Thank You
Bo Hunter
|
|
|
|
|
|
Dear friends:
My team has the following task to complete.A solution that consists of 3 projects :
1-Win app that connected to a local DB server(SQL server) .
2-Web app that connected to a remotre server(SQL server).
3-Mobile app for that connected to tha same remote server of the web app.
The Details:
1-The win app deals with a DB(Local DB SQL server) for updating ,retriving,inserting and deleting.
2-The web & the mobile app deal with a DB(Remote DB SQL server) for tha same purpose.(updating ,retriving,inserting and deleting)
The Goal:
1-The Win app will connect one time per day to update the Remote SQL server with the new data from the Local SQL server.
2-The Web and mobile app connected to the Remote SQL server will update ,retrieve ,delete and insert records in it.
The Questions:
1-If I can use Asp.net web services ,How can I use it?
2-How can i make daily transaction to update the Remote SQL server with the new data at the Local SQL server??
3-How can i make daily transaction to update the Local SQL server with the new data at Remote SQL server ??
4-How can i manage the DB Transactions ?
5-how can i use the same methods(code) for dealing with the DB ,for the win app , the web app and the mobile app?
6-What is the best way to complete this solution?
Thanks for reading to this line.
I hope you can help me.
thanks again.
Best Regards
Ahmed Gaser
FCSIS
IS Dept.
|
|
|
|
|
Without going into details, .NET will provide you a complete solution, search the forum, similar questions like this has been asked when .NET was relatively new.
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
Hmmmm... This sounds suspiciously like a class project....
Some pointers - You'll have to do the grunt work yourself...
1. If you have the ability to use ASP.NET WebServices then you can use them to abstract your business logic what ever that happens to be in the context of this project.
2 & 3: Look for information on replication. Data publishers and data subscribers.
4. That depends on what you mean by "manage"... My own belief is to use stored procedures to manage all access to the database.
5. See 4
6. That is very vague. What are your priorities?
--Colin Mackay--
|
|
|
|
|
I know how to do this via Win32 API's, but curious about how to do it in
.net. Is there a way in the framework to change the system's locale? System, not a thread's locale (found this easily in msdn). Doing this for a tool to help automate testing.
Thanks,
Juan Miguel Venturello
|
|
|
|
|
Look at the CultureInfo class, not sure if u can change it though
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
As far as I can tell, you can only use this class to change on a per thread basis, I need to change window's locale programatically (like when using the regional settings control panel applet, or the win32 API's)
Thanks leppie. Anyone else knows?
|
|
|
|
|
Set Thread.CurrentUICulture to the desired CultureInfo . If you have controls that have already been initialized, you'll have to re-initialize them (note, not necessarily reinstantiate them) with a ResourceManager to have the new culture's information read from the satellite assemblies. If Windows's regional settings specifies a different culture for the UI, this all happens by default using the selected language, if available. Otherwise, the ResourceManager resorts to the neutral resources language (the localized resources in the assembly that contains your code). You should use the assembly attribute, NeutralResourcesLanguageAttribute , to keep the ResourceManager from making unnecessary look-ups for satellite assemblies for the culture that is already included in your primary assembly.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Thanks heath but... I already know all this. Again, I need this application to change the system's locale. I know this will not change the locale of running processes, but will determine the locale of new ones. This is what I need - this little applet is for performing a repetitive testing operation we need to do in several locales. About which locale this applet runs in... I don't care! It is not even localized. The app I am using to test of course is.
I am currently calling a C++ DLL which does the correct calls kludgy! (SystemParametersInfo with SPI_SETDEFAULTINPUTLANG)... kinda works but I want to know if there is something in the FCL to do this.
Thanks,
Juan Miguel Venturello
|
|
|
|
|
Juan Miguel Venturello wrote:
I wan't to know if there is something in the FCL to do this.
I somehow doubt that they would give a bunch of GUI programmers that liberty
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
So, basically, same as so often, use API's because FCL does not offer everything you need...
I know the concept goes way beyond this, but sometimes the FCL just seems like another wrapper around the API's which, to do some things, you need to call directly. Good old API's, glad I learnt them. Same story as VB programmers wanting to do things, having to call API's and getting all confused because they have no idea what an API, handle, etc, is....
Sure the framework/clr offers a ton of interesting things and makes things much easier, but why only offer a subset of the functionability of the API, not all? (like in this case). To make it portable to other platforms???!?
Whatever, thanks for taking time to reply.
Juan
|
|
|
|
|
It's supposed to be a wrapper. The ability to P/Invoke makes framework extensible, although not portable as you mentioned. I haven't checked yet, but I'm betting Mono does support P/Invoked calls, albeit in a different library. I'm not defending this design, just mentioning that Microsoft has been very clear about this. It's not another Java - similar concept, different implementation. The JVM takes care of all the OS-specific operations, but the CLR is meant only to manage the objects and provide interoperability services. It sure beats JNI! (Trust me, I know). I guess you could say that they really differ most on how they handle native calls and both have advantages and disadvantages in the way they handle them.
Also, sorry I didn't notice that you said "system locale" in your first post. I read the thread before I posted originally and guess it just completely slipped my mind.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
while(sReader.ReadLine()!=".")
{
retrMessage.Add(sReader.ReadLine());
}
sReader , my StreamReader reads a network stream from a POP3 server one line at a time and adds it to my array retrMessage[] .
Well, at least... it DID. I changed retrMessage from a string[], to an ArrayList. And now for some reason, only every other line is stored into the ArrayList (it skips lines).
Um, I'm assuming that this is an arraylist problem, because the string[] was handling it fine.
Does anybody have some inside on what's going on, and how I can fix this?
/\ |_ E X E GG
|
|
|
|
|
eggie5 wrote:
while(sReader.ReadLine()!=".") { retrMessage.Add(sReader.ReadLine()); }
That code is just wrong, I'm not gonna even read the rest, try spot the mistake!
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
|
Hint: When you do a ReadLine the stream advances.
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
So, this is a StreamReader problem...? I though it had to do with the ArrayList... hmm...
/\ |_ E X E GG
|
|
|
|