|
|
|
Hi,
After I copy and paste some excel cells into a richTextBox in window form, how can I edit the excel data in the richTextControl, so that it can reflect the changes back in the excel source ?
Thanks
|
|
|
|
|
Hi!
If you simply paste Excel cells into a RTB, they're pasted as a RTF table without any information that the cells have been put into the clipboard from a certain Excel sheet. So there is no way back.
You're out of luck here, sorry.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hi,
I need to import data in an XML file onto an Excel sheet using C#. How can I do this?
I tried using XMLIMPORT method, but its for MS Excel Professional Edition only and I am working with MS standard edition.
Rgds,
UH
|
|
|
|
|
I have an array of letters which’s makes a word and I was wondering how I could compare a user’s input letter against the letters in the array so when running it would display something like this
Example
** Word to be guessed in array – train **
User inputs letter a
Displays _ _ a_ _
User inputs letter n
Displays _ _ a _ n
User inputs letter t
Displays t _ a _ n
And so on until the word is complete.
If some1 could provide an example I could follow id be most grateful as I purchased a book a few days ago on c# programming and this is one of the tasks it doesn’t really give much info on how to do it. i know it uses a loop to move along and check each character but im not sure on this.
thanks
|
|
|
|
|
sound like hangman
Programmer: A biological machine designed to convert caffeine into code. * Developer: A person who develops working systems by writing and using software.
[ ^]
|
|
|
|
|
in a way yes, i guess it is the same principle, but i dont need to draw anything i think that is later on in the book, i have just been given a word in a string that i need to get the user to figure out, but its not very clear
|
|
|
|
|
neptune2k wrote: I purchased a book a few days ago on c# programming
It is a common misconception that learning to program is "equal" to learning a programming language. Evidence of it abounds here in these forums. Anyway, you need a book on Programming Logic and Design[^].
led mike
|
|
|
|
|
I've enabled drag/drop on several ListBoxes via the MouseMove event. When I call MyListBox.DoDragDrop(...) from the event however the SelectedIndexChanged event doesn't always fire, and the various ListBox.SelectedFoo properties do not update. I can get the selected items for the drag/drop action by calling the GetSelected method for every item in the listbox, but having to do so is an ugly hack.
More seriously, I can't safely manually call the method I have attached to the SelectedIndexChanged because if the event has never fired normally, trying to access the SelectedIndex property returns an IndexOutOfRangeException. If I comment out the call to DoDragDrop, this problem never occurs so I know somehow it's responsible for what's going on.
--
Rules of thumb should not be taken for the whole hand.
|
|
|
|
|
I've partially kludged around this by setting SelectedIndex at the same time as I'm using the GetSelected Method to check which items are selected to generate my drag/drop event.
This appears to fix the problem about 99% of the time. Occasionally however, while doing a series of very frantic clicks on the list I manage to get two items shown as selected in the UI even though clicking on one should automatically clear the selection on the prior item. When this happens, I'm still having my SelectedIndexChanged event fire with the SelectedIndex property filled iwth an indexOutOfRangeException. When looking at the returns from GetSelected in the debugger, only one of the two items that appear selected in the UI are returning true.
The listbox is using the multiExtended selection mode, so it shouldn't be possible to select multiple items with hte mouse at all.
--
Rules of thumb should not be taken for the whole hand.
|
|
|
|
|
Hi All,
I have a c# form for the user to fill in the registration info. However, the user will get Syntax error (missing operator) in query expression when he fill in the form with "'s" or "<%" or "<#". I am using Regex.Replace(textbox.Text, "'", ""); but I need to save the "'s" in DB. I would like to know if there any solution for this issue? Thanks in advance.
TMA
|
|
|
|
|
TMATMATMA wrote: I have a c# form for the user to fill in the registration info. However, the user will get Syntax error (missing operator) in query expression when he fill in the form with
This is because the values are being "injected" into the SQL Command. A very bad practice that leads to innumerable security failures for your database.
Read this article[^] it will tell you exactly why you are getting the problems you are getting and exactly how to fix it.
|
|
|
|
|
hi folks
how do i set the margin and paper to landscape in the code window with reportviewer
let say am using c#
|
|
|
|
|
There is a very good site @ report viewer. http://www.gotreportviewer.com[^] Hopefully this will help.
Jayant D. Kulkarni
Brainbench Certified Software Engineer in C#, ASP.NET, .NET Framework and ADO.NET
|
|
|
|
|
Since I am new to database, I want to know how to approch that.
Assume that I have a table, I call it table A with the follwoing fields
A | B | C | D
==================================
Now, table A will take value from the fields like
[A1], [B1], [C1], D[1] etc.
Given that for each value added to field A, I want to create another table. For instance, for the above example, I will have a table A1 with fields like
A11 | A12 | A13
===============
The same for A2 etc.
The way to look at it, for each value added to field A of the original table, I want to have another table. I want to know if this is the best way to do it. I couldn't find any other way.
|
|
|
|
|
If the relation is 1 to n then it is ok
Each item of table B would have an index refering to Table A item.
But if it is an n to n relation, then you should have your two tables (A & B) and then a Table C with A & B indexes.
Hope it helps.
|
|
|
|
|
Only the value from field A determine the next table that will be created. I think this is a 1:n
|
|
|
|
|
mfcuser wrote: Only the value from field A determine the next table that will be created.
Creating multiple tables in this scenario will hurt the managability of your database. You can do it if you want, but it would create more problems than it solves.
|
|
|
|
|
siskhoalanka wrote: Each item of table B would have an index refering to Table A item.
No. An index will not help in this situation - it may affect performance, but it will not assist the joining of two tables.
You need a foreign key on table B - and again with your example with the many-to-many join.
|
|
|
|
|
mfcuser wrote: The way to look at it, for each value added to field A of the original table, I want to have another table.
No - You have a second table that has a foreign key that links it to A. You do not need multiple tables linked to A in this situation.
Table A needs a primary key - this is a column (or group of columns) that uniquely identify a single row in table A.
Table B needs a primary key (pretty much all tables need a primary key) and a foreign key. The foreign key has the same structure as the primary key of the table it links to (in this case table A). So, for example, if the PK of table A is an integer the foreign key on Table B that links to table A must also be an integer.
When you insert rows in Table B that link back to Table A then you put into the foreign key the value of the primary key of the row in A that you want to link to.
Does this help?
|
|
|
|
|
You may also consider that this type of question may be better asked in the SQL forum in future - You will get a greater number of people who know databases better than here - although the majority of C# developers will also know how databases work.
|
|
|
|
|
Thank you for your input, but I am a beginner in sql. The way to look at it, in a long term. Will not be manageable, but it is easier for me to understand.
Again, lets look at it in terms of matrix
Table A = [A1 A2 A3 A4];
Inside table A, we can have something like that
A1 A2 A3 A4
===================
a b c d
e f g h
now I have two table
Table a and table e with fields on their onw
another way to look at it, if I have two table A and B. If I look at the contain of field A1 to enter data on table B. I cannot do that by row, because some of the field will be blank. Keep in mind I don't have much knowledge on database.
|
|
|
|
|
mfcuser wrote: Again, lets look at it in terms of matrix
Table A = [A1 A2 A3 A4];
Inside table A, we can have something like that
A1 A2 A3 A4
===================
a b c d
e f g h
now I have two table
Table a and table e with fields on their onw
I don't see a table a and table e - I see two rows where colum A1 has a value of "a" in one row and "e" in the other row.
mfcuser wrote: if I have two table A and B. If I look at the contain of field A1 to enter data on table B. I cannot do that by row, because some of the field will be blank. Keep in mind I don't have much knowledge on database.
This confuses me even more because I have no idea what you are describing.
Why not drop the A, B, etc. and use a real world example? It is less abstract and easier to understand.
|
|
|
|
|
I am just brainstorming the design. What I said, you have table A inside table A you have fields A, B, C, D.
Now, inside field A, you have data A1, A2, A3 etc. You can call them rows as well. Now, I want to create new tables for those fields. For example, I will have three new tables: A1, A2, A3. The way to look at it, for each value in field A, I have a new table or you can call it for each row.
I don't think this is a good design, but it is simpler for me to understand.
This may have a similarity, but I don't hink it is the same as what I want to do. Assume that you have a table for customers; you also have a table for customer order. I can see there is a relationship between these two tables.
This is what I really like to do, but I don't know if database allows you to do that. Can you have a table inside a table? If you look at it in a spreasheet form like a grid. You can click on one cell and have another grid open.
|
|
|
|