|
No, you can't write a true ISAPI filter in C#. ISAPI requires that the .DLL export the functions required by the interface, but managed code .DLL's do not export functions in a manner compatible with the requirement.
HttpHandlers offer the equivilent functionality.
|
|
|
|
|
hello all
i am trying to serialize an access database into xml file then recreate the database again from the xml file, i ma using "Microsoft ADO Ext. 2.8 for DDL and Security"
here is a sample code of recreating the database from the xml file.
DS2 = new DataSet();
DS2.ReadXml(Application.StartupPath + @"\DataSet.xml");
DataTable temp = DS2.Tables[0];
string strConn="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Application.StartupPath+@"\DataSet.mdb";
ADOX.CatalogClass cat = new CatalogClass();
cat.Create(strConn + "; Jet OLEDB:Engine Type = 5");
cat.Tables.Append((Object)temp);
cat=null;
but i got a com exception says "Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another".
can anyone help?
|
|
|
|
|
From the code, I understand that you are trying to create table in access from the dataset but your approach is not acceptable for ADOX.
In a similar task, I have tried to export my dataset to an mdb database and I had to construct SQL commands from the dataset to create and insert data. I think this one can give you a starting point.
Here is my create table method:
private void CreateTables()
{
string sqlCommand = "CREATE TABLE ";
foreach (DataTable dTable in currentDataSet.Tables)
{
string sqlCreate = sqlCommand + dTable.TableName + "(";
int cnt = 0;
foreach (DataColumn dColumn in dTable.Columns)
{
string sqlCreateCommand = sqlCreate + dColumn.ColumnName;
if (cnt != dTable.Columns.Count - 1)
{
cnt++;
sqlCreateCommand += GetDataType(dColumn) + ", ";
}
if (dTable.Columns.IndexOf(dColumn) == dTable.Columns.Count - 1)
{
cnt++;
sqlCreateCommand += GetDataType(dColumn) + ");";
}
sqlCreate = sqlCreateCommand;
}
OleDbCommand dbCommand = new OleDbCommand(sqlCreate, (OleDbConnection)dsConnection.CurrentDbConnection);
dbCommand.ExecuteNonQuery();
}
Always keep the Murphy Rules in mind!
|
|
|
|
|
hello,
Is it a way to detect if the user has back or post his system date.
Best regards.
dghdfghdfghdfghdgh
|
|
|
|
|
Only by storing the current date somewhere, so that when you check, you have another date to compare it to.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi,
if all you need is a rough indication when the date has been turned back, there are lots of files and folders that get modified by the system when a user is busy (e.g. C:\pagefile.sys, C:\System Volume Information, ...) So one way could be to do a (partial) scan of your disk and determine the most recent file action, if today is earlier than that some one modified the clock, or there is some software that has issued a wrong filedate; so you may want to use a blacklist for some files/folders.
|
|
|
|
|
Hi,
In my application i am using multi threading.For each thread i am calling an exe using System.Diagnostics.Process .What my doubt is if i have 100 threads then i need to call that exe for 100 times so will this degrade the performanace of application .I was not able to handle that code (which has written in exe) in my project thats why i hav written that in seperate application and calling that exe in my project.Just i wanted to know is this a correct way.
Thank You
|
|
|
|
|
I think it will definitely degrade the performance. You can use ThreadPool to limit/control the concurrent threads that load your external program.
Regards,
Lev
|
|
|
|
|
100 threads are rarely if ever going to perform as well as a couple of well though out threads. Not unless you have 100 processors.
I can't work out exactly what you're doing, from your description.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I dont know so much about C#, but cant you start a bunch of threads in one exe module. In C++ there are Threading-Functions, like AfxBeginThread which do so.
You probably got to redesign than your code.
Greetings from Germany
|
|
|
|
|
I am developing an e-learning application. When I draw anything in my custom control, each and every X,Y position send to the server one by one. From the server each message received sends to all the connected clients. I am using socket connection for this. The message will be like “X:Y:Type”, for eg:- “10:20:Line”. So when I draw a line number of such message are send to the client.
Server receive message from IAsyncResult in byte array and it send to all other connected clients.
Each message should like “X:Y:Type” for eg:- “10:20:Line”
My issue:
When I draw a line little fast in a client side all the messages are jointly send. For eg:- instead of “10:20:Line” message looks “10:20:Line10:21:Line10:22:Line10:23:Line10:24:Line10:25:Line10:26:Line10:27:Line” like this. If I draw the line slowly its working fine, messages are received one by one and the drawing is ok.
How can I receive the message one by one when client draw very fast or using slow network connection.
Regards
YPKI
|
|
|
|
|
Queue them on the server, and send them with the appropriate break between them, or a break character.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
please give more explanation about how to do queue and break
Regards,
YPKI
|
|
|
|
|
Just add items to a list as the person draws and your code to send the items, should insert some sort of line break between them, or should wait a certain amount of time before sending the next one. Hard to be more specific without seeing the code.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Please check the following code.
//Client side code
public void SendMessage(int x,int y,string msgType)
{
string str = x.ToString() + ":" + y.ToString() + ":" + msgType; // “20:10:Line”
Byte[] byteDateLine = Encoding.ASCII.GetBytes(str.ToCharArray());
m_sock.Send(byteDateLine, byteDateLine.Length, 0);
}
//Server side code
public void OnRecievedData( IAsyncResult ar )
{
SocketChatClient client = (SocketChatClient)ar.AsyncState;
byte [] aryRet = client.GetRecievedData( ar );
string message = System.Text.Encoding.ASCII.GetString(aryRet, 0, aryRet.Length);
Console.WriteLine("Message :- {0} ", message);
}
In a same ip address the message is sending correct and drawing is ok. When it come diffrent ip address the message getting concatenated.
Regards YPKI
|
|
|
|
|
OK, so like I said, the most basic thing you can do, is to add a character, like say !, or \r, or something, and then split your string when it comes in, on that character, so you get the individual messages one at a time to process.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
i have a web service and when it get the ID it talks to Db and get the relevent infrmation, my application also need to get this information at the same time, (infomation relevent to the ID got by the web service)can any one suggest a way for this problem
|
|
|
|
|
What application ? What's the relationship here ? You can't do what you want to, unless you create a network connection between your webservice and your application, or your app exposes a webservice somehow.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
both are in the same system but they are not interacting with each other,the web service is used by the mobile device and it talks to Db through web service,once it get the id as an input,
my desktop application wants to monitor the user who enterd the id to mobile device and keep records about the user.
|
|
|
|
|
actually what i want is ,when the mobile device call the web service the web service should send the information to ny desktop application as well as the mobile device
|
|
|
|
|
You have a design problem, your desktop app has no association with your service. I would add another interface to the service to be used by the DT app that sends the monitored information.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Yep, and like I said, you need something listening on the desktop side to do that. Do you REALLY need that, or would it suffice for the desktop app to show data from it's own calls to the webservice ? If you need it to update itself, what if it called the webservice every minute to find out about any new data ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
thanx,as you says i have to create an interface to the web service isn't it? i don't want to call the web service diectly, instead i just wnat to get the infromation which got by mobile device,
i tried to achieve this by creating a tcp client in web service and creating a server scoket in my DT app. when the service is called it writes data to the socket in the DT app, do you think this is possible and is there any disadvantages?
|
|
|
|
|
If your app can call the webservice to announce it's IP address, then you could set up a TCP/IP connection directly. I still think polling a webservice is a better idea.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi,
Is there any open source SMTP server written in C# with the below functionalities:
1. Receive mails from SMTP clients
2. Queue in any medium (DB or filesystem)
2. Delivering of mails (mentioned in to address)
It would be great if you can help me to find one . Most the open sources i came across does not support delivering of mails.
|
|
|
|