|
I guess I was writing my own reply at the same time that you were writing this one. I just wanted to say thanks for your response. It's kind of you to help out, even though in this case I had figured it out too (usually I don't figure it out on my own).
Thanks!
The ends can never justify the means. It is the means that determine the ends.
|
|
|
|
|
Is there any wya to add the "Dates" column so that it will be the first column in the data grid?
Thanks!
The ends can never justify the means. It is the means that determine the ends.
|
|
|
|
|
If you want to display Date Column at firs Add it First Before You Fill The DataTable a modification of previous code that will display Date column at first will be as following
DataTable table=new DataTable("Customer");
DataColumn dc=new DataColumn("Data");
table.Columns.Add(dc);
sqlDataAdapter1.Fill(table);
dataGrid1.DataSource=table;
MCAD
|
|
|
|
|
Could you please stop using that background image. It makes reading your posts all but impossible.
|
|
|
|
|
What background image you are taking about?
are you mean
This Not background image it is pre tag
MCAD
|
|
|
|
|
Yes that's exactly what I'm refering to. I don't know what you want it to do, but in both firefox and ID it's streching the length of the screen and making the text behind unreadable without highlighting with the mouse.
|
|
|
|
|
Sorry for annoying you
but nothing from what you mentioned appear in my screen
So i use it to highlight the code and its displayed whith out problem
MCAD
|
|
|
|
|
What's it look like in your browser, in FF1.06 and IE6 the area is tiled with a letter image.
Anyone else seeing the same?
|
|
|
|
|
I'll answer my own question now that I figured it out. Just in case anyone else ever wants to know...
Right, so the problem was thinking that the table I created on this line:
ClaimsTable = new DataTable();
was the same as the table created by the data adapter fill method:
da.Fill(ds, "ClaimsTable");
But the two are not the same. To access the table with my data I need something like da.tables[0]... So when I ran the foreach (DataRow row in ClaimsTables.Rows) I was accessing a table that had been created, but that had no rows.
So essentially I had two tables with identical names, but one held data and one did not and I needed to learn how to access the one that DID hold data.
Yay for learning experiences.
The ends can never justify the means. It is the means that determine the ends.
|
|
|
|
|
Good you figured it out As you guessed i wrote my previous message when you sent your message any way
I Update it may look to it
MCAD
|
|
|
|
|
To explain it in detail:
I wrote an MDI, where there is on window where there are 2 listboxes, that i use to dump incoming network traffic.
I add the strings via:
lstBox.Items.Add(string), where lstBox is my ListBox instance.
So the listbox is updatet at about 10Hz, .
So the problem is, when i open another MDI Child Form, the Form with the Listbox, focusses 10 times a second, hiding the other window if they overlap.
Is there a way to stop the listbox from drawing the focus when adding an item?
thnx in advance, Mike
|
|
|
|
|
Try
listBox1.BeginUpdate(); Before adding items
And call after you finish
listBox1.EndUpdate();
MCAD
|
|
|
|
|
that would work if i would just add a whole bunch at once.
But the output has to be real time, so it still draws the focus.
The code in question is this function, which is called at about 10Hz:
<br />
<br />
private void UpdateList(ListBox lstBox, string rsp)<br />
{<br />
int intIndex = lstBox.Items.Add(DateTime.Now.ToString("H.m.ssff")+": "+rsp);<br />
lstBox.SelectedIndex = intIndex;<br />
if(intIndex > lstMax)<br />
lstBox.Items.RemoveAt(0);<br />
<br />
}<br />
<br />
any other suggestions what to do?
i could use a text field too, but there i dont know how to keep the field from allocating more and more memory.
here i just delete all entries over lstMax's Value.
|
|
|
|
|
You sure you're using BeginInvoke[^]? Your incoming network traffic is most probably on another thread, so you must use Invoke or BeginInvoke to marshal the call to the UI thread.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
i programmed the network traffic via asynchronous network traffic, so as far as i understand, i dont have to take care about threads with this anymore .
|
|
|
|
|
I assume you're using BeginXXX and EndXXX methods. While you don't need to do any thread management, they still run on different threads, you have to use BeginInvoke/Invoke when you are trying to invoke methods on the UI.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
hi everyone,
i would like to write a setup/installer like c# program. there will be 3 button at the buttom of the form; prev, next, cancel, and something other controls will be available above of these 3 button, and will change the top-side of the form every time "next" button clicked. how can i do this. is there any name of this style like MDI. sorry for my poor english, i hope you understand what i meant. i'll wait for your answers, thx.
Ali Aslandas
|
|
|
|
|
|
Thank you very much, that is really what i'm looking for.
best regards,
|
|
|
|
|
How can i scan or find text in images such as jpegs? FOR EXample, I am going to find the word "Hello" in a letter scanned in JPEG Format.. Is there a way?
|
|
|
|
|
|
Yes. Actually I am working with an OCR application. The thing is it converts and identifies the characters or letters in a scanned document ans saves the identified or converted texts in a jpeg file. So i must read the text in the jpeg file. How is this possible?
|
|
|
|
|
Hi! I am trying to send digitaly signed message from my program via CDO. I used examples from site and MSDN. Message was delivered, but i ended up with mail client telling me "ASN1 tag: unexpected end of data". Can anyone tell me what's wrong?
<br />
string test = msg.BodyPart.GetStream().ReadText(msg.BodyPart.GetStream().Size);<br />
<br />
Encoding ascii = Encoding.ASCII;<br />
Encoding unicode = Encoding.Unicode;<br />
byte[] unicodeBytes = unicode.GetBytes(test);<br />
byte[] asciiBytes = Encoding.Convert(unicode, ascii, unicodeBytes);<br />
<br />
string SignedMsg = SignFromText(asciiBytes,false,Encoding.UTF8);<br />
<br />
msg.BodyPart.ContentMediaType = "application/pkcs7-mime;smime-type=signed-data;name=\"smime.p7m\"";<br />
msg.BodyPart.ContentTransferEncoding = "base64";<br />
msg.BodyPart.Fields["urn:schemas:mailheader:content-disposition"].Value = "attachment;FileName=\"smime.p7m\"";<br />
msg.BodyPart.Fields.Update();<br />
byte[] tmp = unicode.GetBytes(SignedMsg);<br />
msg.BodyPart.GetDecodedContentStream().Type = ADODB.StreamTypeEnum.adTypeBinary;<br />
msg.BodyPart.GetDecodedContentStream().Write(tmp);<br />
msg.BodyPart.GetDecodedContentStream().Flush();<br />
<br />
msg.Configuration = cdoConfig;<br />
msg.Send();<br />
<br />
public string SignFromText(byte[] plaintext, <br />
bool bDetached, Encoding encodingType) <br />
{<br />
CAPICOM.SignedData signedData = <br />
new CAPICOM.SignedDataClass();<br />
CAPICOM.Utilities u = new CAPICOM.UtilitiesClass();<br />
signedData.Content = u.ByteArrayToBinaryString(plaintext);<br />
CAPICOM.Signer signer = new CAPICOM.Signer();<br />
CAPICOM.Certificate ClientCert = new CAPICOM.Certificate();<br />
try<br />
{<br />
CAPICOM.Store MyStore = new CAPICOM.StoreClass();<br />
MyStore.Open(CAPICOM.CAPICOM_STORE_LOCATION.CAPICOM_CURRENT_USER_STORE,"My",CAPICOM.CAPICOM_STORE_OPEN_MODE.CAPICOM_STORE_OPEN_READ_ONLY);<br />
foreach(CAPICOM.Certificate c in ((CAPICOM.ICertificates2)MyStore.Certificates))<br />
{<br />
if(c.SerialNumber==m_config.GetOwnCert())<br />
ClientCert = c;<br />
}<br />
}<br />
catch(Exception ex)<br />
{<br />
MessageBox.Show("Error : "+ex.Message );<br />
}<br />
<br />
signer.Certificate = ClientCert;<br />
string _signedContent = signedData.Sign(signer, bDetached, <br />
CAPICOM.CAPICOM_ENCODING_TYPE.CAPICOM_ENCODE_BASE64);<br />
return _signedContent; <br />
}<br />
|
|
|
|
|
Is it possible to make a custom dialog that implements features of standard dialogs. E.g. a custom dialog should have two FontDialogs (in two tab pages for example). How to use standard FontDialog to implement this custom one, in order not to make it from scratch.
|
|
|
|
|
FontDialog is using windows api this
Make the modification of it not easy as other .net class
but you can still inherit from it and override
HookProc Method to add your customization
For more info
FontDialog.HookProc Method[^]
MCAD
|
|
|
|