|
Message Closed
modified 23-Nov-14 6:58am.
|
|
|
|
|
hey,
I' am going to update to the latest version and try your code.
It will probably solve my problem.
thanks a lot.
|
|
|
|
|
Hi,
I'm working on a WebDAV Application.. I can now connect to an ip, say, http://localhost:9005/MyWeb/ by creating a web folder. I could create and delete the web folder using C# code... I could traverse my web folder thoroughly... Is it possible for me to map this web folder to a new drive (using C#) so that I can access the contents from a drive in My Computer..? A software by name NetDrive is able to do it... Pls suggest on how I can achieve this...
Thanks,
ramzg
|
|
|
|
|
If I create a new Windows Forms Application and double click on Form1.cs in Visual Studio, the code editor appears. Normally, I'd expect the designer to open up so I can drop controls and the like on my new form.
There's a setting somewhere I think - but don't know where.
Any ideas?
Regards,
Rob Philpott.
|
|
|
|
|
Cancel that, I've found it. Right-click then open with and set as default. I am stupid.
Regards,
Rob Philpott.
|
|
|
|
|
additional you have above the form1.cs in your solution view several buttons..
one is to show the code and an onther one is to show the designer..
|
|
|
|
|
Hello Friends,
i am working on a desktop application that i have build in VS2005 using C#.
In this application user needs to login to get in. first i have placed my database created in MS Access in same installed directory and i have connect with it to verify the users credentials. now my requirement is bit change. i want to place MS data base on a center point from where every one can access the DB for login. can u please let me know how i can establish the connection between them.
my previous connection string was this.
string strDBPath = AppDomain.CurrentDomain.BaseDirectory + dbChartImager.mdb";
OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + strDBPath + ";Jet OLEDB:Database Password=supna786;Mode=ReadWrite|Share Deny None");
this was working fine.
now i have upload my db on a server and trying to access with following connection string but is not working.
string strDBPath ="http://domainname.com//dbChartImager.mdb";
OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + strDBPath + ";Jet OLEDB:Database Password=supna786;Mode=ReadWrite|Share Deny None");
please let me know how i can access it. and if possible please provide some sample code that can help me.
Thanks
|
|
|
|
|
And what is the error you're receiving..?
|
|
|
|
|
i am getting the exception when i try to connect that "Not a valid File Name"
|
|
|
|
|
You're probably entering the wrong path to the .mdb file then. I'm not sure how the syntax for the connection string to an Access database is suppose to look..
modified on Wednesday, December 2, 2009 6:13 AM
|
|
|
|
|
i am giving the right path of file. There is no problem with path. do you think that i am doing right to access the MS Access file in this way from a hosing server. is there any other way to access a mdb file from a hosting server to window's application?
|
|
|
|
|
You could access it using a webservice and let the webservice reside on the same machine as the database. Then have a reference to the webservice in your client (windows) application.
|
|
|
|
|
why do you use "http://domainname.com//dbChartImager.mdb";
why not "http://domainname.com/dbChartImager.mdb"; ??
|
|
|
|
|
The error you're getting is telling you it's NOT correct.
And it's rigt - you cannot access an Access database over HTTP. Access is a file-based database and you haven't provided a filesystem based path to the database.
|
|
|
|
|
if i could not access it using http then how i can access it.
Actually my idea is to place my database on a center point on some where hosting server that every user can access it through internet(not local network). every machine where my desktop application will install will be connect to this database for login verification.
if i could not access it through http then what will be the pay to access it? can you please some sample code in which i can access it.
say my database is on http://domainname.com/dbChartImager.mdb
then how i can get it execute a query?
|
|
|
|
|
sher_azam wrote: Actually my idea is to place my database on a center point on some where hosting server that every user can access it through internet(not local network
Through the Internet, you cannot use an Access database directly. You have to go through some webserver that does the database access for your application. Your app can talk to the webservice over HTTP.
|
|
|
|
|
Member 4624055 wrote: string strDBPath ="http://domainname.com//dbChartImager.mdb";
You cannot connect to an Access database over HTTP like this.
What are you trying to accomplish here? Is the idea that people will be able to run the application remotely, connecting to the central database via an internet connection? Or are all the users running on the same local network, i.e. sharing the same central database, but not over the internet?
|
|
|
|
|
Actually my idea is to place my database on a center point on some where hosting server that every user can access it through internet(not local network). every machine where my desktop application will install will be connect to this database for login verification.
if i could not access it through http then what will be the pay to access it? can you please some sample code in which i can access it.
say my database is on http://domainname.com/dbChartImager.mdb
then how i can get it execute a query?
|
|
|
|
|
As some people here pointed out, the "database" of your choice doesn't support access over http so my suggestion is to have a web service which all clients connect to and then user name and password can be validated against your database. Good luck!
|
|
|
|
|
Thanks Calla,
i think web service is the best solution for this. i will go for it. thank you so much for you all my friends.
|
|
|
|
|
You're welcome
A webservice also gives you the advantage of being able to change your business layer (maybe your database change layout or you switch databases) without having to change anything in any of the clients. So from an architectural point of view this is also a better and more flexible solution.
|
|
|
|
|
I've followed the following tutorial: http://msdn.microsoft.com/en-us/library/system.net.security.negotiatestream%28VS.80%29.aspx[^]
and have implemented a server and client application.
When I use the client to connect to the server on the same machine (i.e. the IP is 127.0.0.1) it makes a secure connection.
When I use the client on my XP machine to connect to the server on my Vista machine then the line:
authStream.EndAuthenticateAsServer(ar);
fails with the exception I pasted into the subject of this post.
What I want to do is allow any client on any machine over the internet or LAN to connect to my server on port 9000 over an encrypted connection.
I would be happy if I could allow the client to specify a username and password - but I don't know how to implement that functionality.
details on the exception:
$exception
- $exception {"The server has rejected the client credentials."} System.Exception {System.Security.Authentication.InvalidCredentialException}
+ [System.Security.Authentication.InvalidCredentialException] {"The server has rejected the client credentials."} System.Security.Authentication.InvalidCredentialException
+ Data {System.Collections.ListDictionaryInternal} System.Collections.IDictionary {System.Collections.ListDictionaryInternal}
HelpLink null string
+ InnerException {"The logon attempt failed"} System.Exception {System.ComponentModel.Win32Exception}
Message "The server has rejected the client credentials." string
Source "System" string
StackTrace " at System.Net.Security.NegoState.EndProcessAuthentication(IAsyncResult result)\r\n at System.Net.Security.NegotiateStream.EndAuthenticateAsServer(IAsyncResult asyncResult)\r\n at RemoteDiagnostics.Server.class_RDServer.EndAuthenticateCallback(IAsyncResult ar) in C:\\Users\\Nuclear\\Documents\\Visual Studio 2008\\Projects\\RemoteDiagnostics\\RemoteDiagnostics\\Server\\class_RDServer.cs:line 280" string
+ TargetSite {Void EndProcessAuthentication(System.IAsyncResult)} System.Reflection.MethodBase {System.Reflection.RuntimeMethodInfo}
authStream
- authStream {System.Net.Security.NegotiateStream} System.Net.Security.NegotiateStream
+ base {System.Net.Security.NegotiateStream} System.Net.Security.AuthenticatedStream {System.Net.Security.NegotiateStream}
CanRead false bool
CanSeek false bool
CanTimeout true bool
CanWrite false bool
+ ImpersonationLevel 'authStream.ImpersonationLevel' threw an exception of type 'System.Security.Authentication.InvalidCredentialException' System.Security.Principal.TokenImpersonationLevel {System.Security.Authentication.InvalidCredentialException}
IsAuthenticated false bool
IsEncrypted false bool
IsMutuallyAuthenticated false bool
IsServer true bool
IsSigned false bool
+ Length 'authStream.Length' threw an exception of type 'System.NotSupportedException' long {System.NotSupportedException}
+ Position 'authStream.Position' threw an exception of type 'System.NotSupportedException' long {System.NotSupportedException}
ReadTimeout -1 int
+ RemoteIdentity 'authStream.RemoteIdentity' threw an exception of type 'System.Security.Authentication.InvalidCredentialException' System.Security.Principal.IIdentity {System.Security.Authentication.InvalidCredentialException}
WriteTimeout -1 int
|
|
|
|
|
I found an example where the client specifies credentials:
http://msdn.microsoft.com/en-us/library/system.net.security.protectionlevel.aspx[^]
but I'm not happy that the client needs to know the username and password of the machine that the server is running on.
If I have to store username and password for various machines in my exe.config then that seems impractical.
I guess I will just go back to using TcpClient.Connect() and encrypting the data myself prior to transmission.
|
|
|
|
|
Well there a few major errors occcuring in the following program:
1) line 18: usleep was not declared in the scope
2) line 14,15,23,..: stray'\160' in the program
3) Also i am getting an error in my process.h file. Can somebody tell where i can get this file. I got it from:
http://www.koders.com/c/fid1DB5A7F33E56F9DDD9AFDC7EF0F05CF767EA426A.aspx
Here is the program:
#include<stdio.h>
#include<windows.h>
#include<pthread.h>
#include<process.h>
#include<unistd.h>
#include<stdlib.h>
/* This is our thread function. It is like main(), but for a thread */
void *threadFunc(void *arg)
{
char *str;
int i = 0;
str=(char*)arg;
while(i < 10 )
{
usleep(1);
printf("threadFunc says: %s\n",str);
++i;
}
return NULL;
}
int main()
{
pthread_t pth;
int i = 0; // this is our thread identifier
/* Create worker thread */
pthread_create(&pth,NULL,threadFunc,"processing...");
/* wait for our thread to finish before continuing */
pthread_join(pth, NULL); // void ** return value could go here
while(i < 10 )
{
usleep(1);
printf("main() is running...\n");
++i;
}
return 0;
}
|
|
|
|
|
Maybe you ought to post this in the C++ forum instead of C#
|
|
|
|