|
I can't make heads or tails out of your question, but I reckon the easiest way to read a CSV is to read a line at a time, then to do a split on the ,. If you can break your request into plain English, I'd be happy to try and help some more.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
I'll just repeat what Christian said... HUH?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello all ,
i tried to use active x component in aspx page but i got this error.
System.Runtime.InteropServices.COMException: Catastrophic failure
please can any one help me.
Regards,
Hay
|
|
|
|
|
This is nowhere near enough information for us to help you.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello Dave,
I use SIP Phone active X component on ASPX Page.but when i try to run the page i got this exception.
Catastrophic failure <br />
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. <br />
<br />
Exception Details: System.Runtime.InteropServices.COMException: Catastrophic failure
Regards,
Hay
|
|
|
|
|
Ok, I have an application that is sitting on a server and listning for requests using a Socket and on port 8221. Well this servers app's sole purpose is to take in what the user wants and run a query based on that incoming requests and parameters.
Ok, application seems to be working fine functionally except for a few issues that I am not having any luck trying to fingure out what to do:
1. I fixed memory leaks, the memory seems to be fairly constant between 6 and 25K. But the problem is that the handle count seems to be going up. For example I am looking at the taskman on the server, the mem is at 7568 and the handles are up to 2800+. How or any suggestions on reclaming these handles back or this is a non issue.
2. Second, since this is a communication app it is sitting on the server minding it's own business and all of a sudden sometimes i see it takes up 99% of the cpu WHILE IT HAS NO PENDING CONNECTIONS.
Any suggestions as to how I can address these issues.
BTW this is one of the best .net blogs i have ever read
http://blogs.msdn.com/ricom/archive/2004/12/10/279612.aspx[^
So, my thanks to this guy for learning and helping me track down my memory leaks.
|
|
|
|
|
Hi
How do I supress the redraw event until my resize is done, i.e. while resizeing a window?
/Johan
|
|
|
|
|
Suppress the redraw event on what? Some things need to be drawn for feedback purposes.
|
|
|
|
|
When press Ctrl+v in richtextbox, how to get the text which is pasted,
how can i do?
|
|
|
|
|
|
hii,
you can do so by using keyup event if the keys pressed were contol+v get the data in clibbord here is simple example
private void richTextBox1_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
{
String PasteText="";
if(e.KeyData==(Keys.Control|Keys.V))
{
PasteText=(String)Clipboard.GetDataObject().GetData(typeof(String));
if(PasteText!=null)
MessageBox.Show(Clipboard.GetDataObject().GetData(typeof(String)).ToString());
}
}
|
|
|
|
|
there's a much easier way.
richTextBox1.Undo();
|
|
|
|
|
HI
My problem is that I am reading a image field from the database table .
then I need to Convert that image field value into a byte[] .
dread = sqlcomm.ExecuteReader();
sqlcomm = new SqlCommand("getCont1" ,sqlconn);
sqlcomm.CommandType = CommandType.StoredProcedure;
dread = sqlcomm.ExecuteReader();
while ( dread.Read())
{ temp= (dread.GetValue(0));
}
this "temp" var store the image field value as object .
now i need to convert this object into byte[] as i have to pass it to a function which take byte[] as parameter.
what I need to do ?
thanks
ss
thanks
|
|
|
|
|
An image SQL server column type translates to a byte array (byte[] )framework type. In your example, the 'temp' variable would have to be declared as byte[] .
You could also use the GetBytes(int index) method on your reader.
For a more complete type mapping table, look here[^].
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
|
|
|
|
|
if you want to convert it to byte array you have to serialize it.
using System.Runtime.Serialization.Formatters.Binary;
/*Note i suppose your object is serializable if not add [Serializable] attrubite to your object class*/
BinaryFormatter Serialize=new BinaryFormatter();
MemoryStream stream=new MemoryStream();
byte[]ObjectInBytes=Serialize.Serialize(stream,temp);
//to Deserialize
stream=new MemoryStream(ObjectInBytes);
stream.Seek(0,SeekOrigin.Begin);
temp=(TypeOfYourObject) Serialize.Deserialize(stream);
marcoryos
|
|
|
|
|
|
Hi there, im working on a little client / server application, and im having trouble sending messages between the two. I can send messages no problem as text, but when I serialize an xml class and send that it gives me an error "There is an error in XML document (6, 16)".
Heres the code:
MessageClass - this is what is being serialized and submitted
//--------------------------------------------
//--------------------------------------------
public class messageClass
{
public int clientID;
public int messageType;
public int data;
public messageClass()
{
}
}
//--------------------------------------------
//--------------------------------------------
SERVER code - this is where the class is declared, filled in and submitted. NOTE: I want "data" to be an object, but ive used int here for debugging.
//--------------------------------------------
//--------------------------------------------
Socket listener = (Socket)ar.AsyncState;
client = listener.EndAccept(ar);
Console.WriteLine("client {0}, joined", client.RemoteEndPoint);
// send the user a session ID
string strSessionID = sessionID.ToString();
sessionID++;
//Byte[] byteSessionID = System.Text.Encoding.ASCII.GetBytes(strSessionID.ToCharArray());
//client.Send(byteSessionID, byteSessionID.Length, 0);
messageClass message = new messageClass();
message.clientID = sessionID;
message.messageType = 1;
message.data = 1;
XmlSerializer xml = new XmlSerializer(message.GetType());
MemoryStream transmitStream = new MemoryStream();
xml.Serialize(transmitStream, message);
client.Send(transmitStream.GetBuffer());
Console.WriteLine("Sent message");
listener.BeginAccept(new AsyncCallback(OnConnectRequest), listener);
//--------------------------------------------
//--------------------------------------------
CLIENT - recieving and decoding message, this is where the error is occuring. Message is recieved but will not parse:
//--------------------------------------------
//--------------------------------------------
public void setupRecieveCallback(Socket sock)
{
try
{
AsyncCallback recieveData = new AsyncCallback(OnRecievedData);
sock.BeginReceive(byteBuffer, 0, byteBuffer.Length, SocketFlags.None, recieveData, sock);
}
catch(Exception ex)
{
MessageBox.Show(this, ex.Message, "Setup Recieve callback failed!");
}
}
public void OnRecievedData(IAsyncResult ar)
{
// Socket was the passed in objct
Socket sock = (Socket)ar.AsyncState;
// check if we got any data
try
{
int bytesRecieved = sock.EndReceive(ar);
if (bytesRecieved > 0)
{
// write the data to the list
//String recieved = Encoding.ASCII.GetString(byteBuffer, 0, bytesRecieved);
//##########################
// DO SOMETHING WITH MESSAGE
//##########################
// decode it back to a message class
messageClass myMessage = new messageClass();
XmlSerializer xml = new XmlSerializer(myMessage.GetType());
MemoryStream messageStream = new MemoryStream(byteBuffer);
myMessage = (messageClass)xml.Deserialize(messageStream);
//byte[] buffer = new byte[2048];
//messageStream.Read(buffer, 0, 2048);
int data = myMessage.data;
MessageBox.Show(data.ToString(), "Message");
//MessageBox.Show(recieved, "Message");
// if still connected, reastablish callback
setupRecieveCallback(sock);
}
else
{
// if no data was recieved then the connection is probably dead
Console.WriteLine("client {0}, disconnected", sock.RemoteEndPoint);
sock.Shutdown(SocketShutdown.Both);
sock.Close();
}
}
catch (Exception ex)
{
MessageBox.Show(this, ex.Message, "Unusual error during recieve!");
}
}
//--------------------------------------------
//--------------------------------------------
Just for cicks here is the actual message that is recieved, pefore trying to parse:
//--------------------------------------------
//--------------------------------------------
<messageclass xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<clientid>2
<messagetype>1
1
//--------------------------------------------
//--------------------------------------------
Any help much appreciated...
|
|
|
|
|
Sorry, forgot to tell it not to treat barckets as HTML. Here is the actual XML that is recieved by the client:
<?xml version="1.0" encoding="utf-8"?>
<messageClass xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<clientID>2</clientID>
<messageType>1</messageType>
<data>1</data>
</messageClass>
|
|
|
|
|
anyone have a simplified process for doing this. I'm on a intranet and I want only people in my desktop administrator group to gain access to my webforms
thanks,
-Josh
|
|
|
|
|
|
|
Hello,
Is there any way to get a list of stored procedures in an MS Access database?
Been searching for a while and found nothing
Thanks in advance
|
|
|
|
|
Create a view in sql server around the following sql statement and select out of the view in access:
select name from dbo.sysobjects where xtype = 'P' and status >= 0 and name not like 'dtp%' order by name
|
|
|
|
|
Excuse my ignorance, but how am I supposed to create a view in sql server working with MS Access?
Could you be more explicit please? Thanks
|
|
|
|
|
Create a view using query analyzer. Grant select to public. Then access it via a function in vba or directly with a linked ODBC data source.
sql:
Create View storedproclist as
Select name
From dbo.sysobjects
Where xtype = 'P' and status >= 0 and name not like 'dtp%'
Go
Grant Select On storedproclist To Public
|
|
|
|