|
Hi,
some comments:
1.
please show code snippets with PRE tags, not CODE tags; you can use the "CODE BLOCK" widget below the edit window for that.
2.
you store the splitted line in splitArray[spl] yet you show splitArray[0].
Not sure what spl stands for, but this might explain your symptoms.
3.
No need to write line.Split(new char[] { '=' }) , a simple line.Split('=')
does exactly the same (the compiler takes care of the char[]).
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
splitArray[spl] ? i haven't defined spl anywhere ?
its just ment to start at splitArray[0] with the first setting and build on after that with the last setting at splitArray[13]
|
|
|
|
|
The you need a loop - either a for(i = 0; ...) or a foreach(string s in...)
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
I am creating a application on C# its a very basic application
structure:
Camp>>Blocks>>Rooms>>Beds
every room can have different no. of beds up to 4
I have to create a reservation screen, any ideas how can I do that?
Regards
Amit
|
|
|
|
|
It looks like a school home work, btw what have you tried till now?
Before starting to code, you need to sit and think of a design.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
The way I always approach this is to sort out the code structure first on paper.
Once you have an outline of the various classes and interfaces along with the basic methods and properties that will be needed you pretty much have your business layer sorted. Designing a UI and a data structure is now pretty easy.
If you do the UI first you will be restricting your code's logic to some extent on the way the data is presented which is going to be painful.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
|
Hi
This is probably a stupid question, but how do you draw borders for the cells of a DataGridView.
I've read plenty but cannot make it work.
I want to draw a vertical line down between two columns from top to bottom of the grid.
This is what I have so far, it doesn't do anything though:
myColumn.CellTemplate.AdjustCellBorderStyle(new DataGridViewAdvancedBorderStyle { Right = DataGridViewAdvancedCellBorderStyle.OutsetDouble },
new DataGridViewAdvancedBorderStyle { Right = DataGridViewAdvancedCellBorderStyle.OutsetDouble },
true, false, false, false);
|
|
|
|
|
I like playing with DataGridViews , so your question interested me. I've done some searching, but the only real examples I can find are overrides of AdjustCellBorderCell for custom columns/cells.
Other sources seem to say the effect can only be observed if the cell/column is selected/in edit mode, depending on who posted the solution. Have you tried both of those situations?
Other than that, and this is pure guesswork (untried)
myColumn.CellTemplate.AdjustCellBorderStyle(new DataGridViewAdvancedBorderStyle { Right = DataGridViewAdvancedCellBorderStyle.OutsetDouble },
new DataGridViewAdvancedBorderStyle(),
true, false, false, false);
might work. The blank placeholder bit is used in a couple of the examples I found.
As I said pure guesswork.
I'm off to play now, so if I get a hit, I'll come back.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Have you seen this[^] from MSDN?
I have modified it slightly
public class DataGridViewCustomCell : DataGridViewTextBoxCell
{
public override DataGridViewAdvancedBorderStyle AdjustCellBorderStyle(
DataGridViewAdvancedBorderStyle dataGridViewAdvancedBorderStyleInput,
DataGridViewAdvancedBorderStyle dataGridViewAdvancedBorderStylePlaceHolder,
bool singleVerticalBorderAdded,
bool singleHorizontalBorderAdded,
bool firstVisibleColumn,
bool firstVisibleRow)
{
dataGridViewAdvancedBorderStylePlaceHolder.Left =
dataGridViewAdvancedBorderStyleInput.Left;
dataGridViewAdvancedBorderStylePlaceHolder.Top =
dataGridViewAdvancedBorderStyleInput.Top;
dataGridViewAdvancedBorderStylePlaceHolder.Right = firstVisibleColumn ?
DataGridViewAdvancedCellBorderStyle.Single :
DataGridViewAdvancedCellBorderStyle.OutsetDouble;
dataGridViewAdvancedBorderStylePlaceHolder.Bottom =
DataGridViewAdvancedCellBorderStyle.None;
return dataGridViewAdvancedBorderStylePlaceHolder;
}
}
which works pretty well.
Still haven't found a way to do it at runtime though.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hello,
I am using microsoft.office.interop.excell to write to excell file.
But i have a problem of saving it.
If i do workbook.saveas and the file exists it asks me if to save it and it rewrites me it (removes the old data).
if i specify it to open a file when i create the workbook:
Microsoft.Office.Interop.Excel.Workbook objBook = ExcelApp.Workbooks.Open(@"c:\Focus Report\123.xls", 0, false, 5, "", "", false, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "", true, false, 0, true, false, false);
and the file doesn't exist it cannot save and throws and exception that the file wasn't found.
So how can i save the file (create if not exist and save it (not rewrite) it if exist)?
|
|
|
|
|
You can use File.Exists("filename") to check if the file exists first.
Simon
|
|
|
|
|
I am assuming that you checked whether your SaveAs command actually created the file. What works for me is to use as many System.Type.Missing objects in the Open call possible. Give this version a try and see what happens:
object c_Missing = System.Type.Missing;
Excel.Application c_ExcelApp;
c_ExcelApp = new Excel.Application();
c_ExcelApp.Workbooks.Open(
(@"c:\Focus Report\123.xls",
false, false, c_Missing, c_Missing, c_Missing, true, c_Missing, c_Missing,
true, false, c_Missing, false, c_Missing, c_Missing);
Hope it helped,
Rolf
|
|
|
|
|
Greetings all,
Being as this is my first posting, please be forgiving on any breaches of etiquet.
I am using FitNesse to test some C# code and am having so problems with it.
My C# fixture has a method to initialise my tests that takes a CSV file and using LINQtoSQL, inserts a bunch of rows into a SQL database so I have a database in a known state.
When I run this method using a console application it works fine and my database is populated.
when I run this using FitNesse, the method fails. It gets as far as creating a LINQ context object for the database but when I check to see that the database exists (which it does. I do not create it on the fly.), the check comes back a false!
Does anyone know why this would be different? Can anyone offer any solutions/ideas?
Any help would be gratefully appreciated.
Thanks in advance,
Nick.
|
|
|
|
|
I have an application using cryptography, mostly in streams (file and memory) which I decrypt as needed into a new MemoryStream. All this works well.
Only thing is, I would like to trash the content of the MemoryStream when I am done with it (as well as strings etc I copy portions into) to prevent it ever getting paged to disk in decrypted form via the swap file.
In "good old fashioned" C++ I would just blitz the data with random rubbish before I deleted it - is there any way with managed objects?
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
|
Thanks! I didn't think of looking for alternatives to string.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Interesting. Not heard of that before, but I'm curious as to how you'd actually use it. For instance, say I wanted to store a password someone had entered into a textbox - that's already available in unencrypted form in the Text property.
Even copying the password character by character which seems to be the norm with this thing would mean presumably interning the Text property of the Textbox - we've already lost the battle.
I think I'm missing something here - although its good that we can store things in memory in encrypted form how do we populate it, access it, compare it etc?
Regards,
Rob Philpott.
|
|
|
|
|
That does seem to be a problem on close inspection - to use it, it seems you have to get a pointer to unmanaged memory and then copy it out. Not sure this is going to quite do what I want - I'll keep looking tho.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Rob Philpott wrote: I think I'm missing something here
Yes, it's a tool. We are supposed to build are own solutions using it like Paul Glavs did[^]
|
|
|
|
|
I'm not that paranoid, but you could probably use unsafe code to wipe the string.
|
|
|
|
|
Let's assume this held your bank account number, login id and password, and your paypal details.
Feeling paranoid enough yet?
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
|
Hi friends,
I wanted to add string resource to all exe and dll used in my project.
All exe and dll used in my project is not .net assembly, few of them are c++ and 3rd party dll.
At runtime I want to add/edit few string to all dll’s and exe’s used in my project, like myVersionInof, myImpectType etc, Which I can use in my project at runtime.
Can you guide me what should I have to use? Resource manager to add string resource.
Or add custom attribute to all my exe’s and dll’s .
Thanks
hiren shah
hirenkshah@gmail.com
|
|
|
|
|
This sounds a bit dodgy to be honest.
What do you actually need to do?
What is the reason for adding an attribute?
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|