|
stonebergftw wrote: I would assume it behaves similar to ArrayList in that if you delete an item (ie myList[3]), that myList[4] would be copied into myList[3] and so on and so forth. Is this correct?
Yep, that's right, same semantics as ArrayList.
Religiously blogging on the intarwebs since the early 21st century: Kineti L'Tziyon
Judah Himango
|
|
|
|
|
Welcome.
You should use more descriptive names for your variables and classes.
e.g consider renaming s1 to columnName and s2 to columnDataType, etc. Also, change the default names for your text boxes and buttons. You'll quickly forget what textBox1 & button1 are when you app grows. Same for forms, give them more descriptive names than Form1 and Form2 like DataEntryForm or whatever make sense for each one.
Keep it up
Simon
|
|
|
|
|
Simon,
I expected a response such as yours like a firefighter expects there to be heat around the flames.
Now that you mention it, I'm going to change all those things before this program gets any bigger. Thanks.
|
|
|
|
|
At least your expecting it. For someone who's only been coding a few days you already seem to be more aware of good practises than some pros I can think of. Nice one.
Simon
|
|
|
|
|
Thanks guys.
I'm really confused how this language relates to SQL(I need to set up a database). Am I correct in assuming that my code actually does set up an SQL database? If so, I need to write it so that the data is not lost upon program termination. Any ideas of what I should be looking for(search wise)? I'm feeling pretty lost right now.
|
|
|
|
|
Hi Guys!
How can I change the Visual Settings of a form or a Button in the form. Will Microsoft Expression Blend(MEB) help? However, thats a separate software and I've heard that it can only be implemented on Web Applications. What about Microsoft Silverlight (is that too meant for only Web applications)? How can I interactively decorate a form from within VS.NET with the controls available? Please Help......
Your help will be appreciated....
Thanx, Rajdeep.NET!
|
|
|
|
|
Rajdeep.NET wrote: Please Help
Why? Are you helpless? Are you incapable of reading the information provided by Microsoft about Expression Blend and Silverlight to understand what they are?
|
|
|
|
|
Thats not exactly what I asked for?
|
|
|
|
|
Rajdeep.NET wrote: Thats not exactly what I asked for?
Really? Then what does this mean?
Rajdeep.NET wrote: Will Microsoft Expression Blend(MEB) help?
In case you aren't aware how these forums work, we can only know what you post, not what you are thinking. I addressed what you posted.
|
|
|
|
|
hey are you trying to do something with the look & feel of your windows programme.
oh yes one thing the blend and silverlight are tasks of web as they use javascript type codings and xmls .
and one thing you cant apply look & feel for a single object like buttons , labels etc.
its changing in whole.
try google with dotnet skins because i forget the link.
--------------------------------------------
work is yours, world is yours
|
|
|
|
|
|
|
Hi to All,
I have a datagridview with some textbox and combobox columns. This shows some data from postgresql.
It works fine bud when im trying to set the DataPropertyName of the combobox column, im getting the error:
System.ArgumentException: The value of DatagridviewComboboxCell is invalid
Here is a part of my code:
NpgsqlDataAdapter da = new NpgsqlDataAdapter(com);
DataTable dt = new DataTable();
BindingSource bs = new BindingSource();
da.Fill(dt);
bs.DataSource = dt;
if(dt.Rows.Count != 0)
{
qDesigner.dgvFilters.AutoGenerateColumns = false;
qDesigner.dgvFilters.DataSource = bs;
qDesigner.dgvFilters.Columns["dgvColTable"].DataPropertyName = dt.Columns[0].ColumnName;
qDesigner.dgvFilters.Columns["dgvColCriteria"].DataPropertyName = dt.Columns["Criteria"].ColumnName;
qDesigner.dgvFilters.Columns["dgvColOr1"].DataPropertyName = dt.Columns["ColOr1"].ColumnName;
qDesigner.dgvFilters.Columns["dgvColOr2"].DataPropertyName = dt.Columns["ColOr2"].ColumnName;
}
Can anyone help me with this issue?
Thanks
modified on Thursday, April 2, 2009 10:53 AM
|
|
|
|
|
Your Code is not completely visible.
|
|
|
|
|
Hi Rajdeep,
Here the complete code:
NpgsqlCommand com = new NpgsqlCommand("SELECT tablee AS Table, columnn AS Column, sort AS Sort, " +
" criteria AS Criteria, or1 AS ColOr1, or2 AS ColOr2 FROM queryfilters "+
" WHERE category='" + category + "' AND queryname='" + descr + "' AND modifier='"+modifier+"'", mycon);
NpgsqlDataAdapter da = new NpgsqlDataAdapter(com);
DataTable dt = new DataTable();
BindingSource bs = new BindingSource();
da.Fill(dt);
bs.DataSource = dt;
if(dt.Rows.Count != 0)
{
qDesigner.dgvFilters.AutoGenerateColumns = false;
qDesigner.dgvFilters.DataSource = bs;
qDesigner.dgvFilters.Columns["dgvColTable"].DataPropertyName = dt.Columns[0].ColumnName;
qDesigner.dgvFilters.Columns["dgvColCriteria"].DataPropertyName = dt.Columns["Criteria"].ColumnName;
qDesigner.dgvFilters.Columns["dgvColOr1"].DataPropertyName = dt.Columns["ColOr1"].ColumnName;
qDesigner.dgvFilters.Columns["dgvColOr2"].DataPropertyName = dt.Columns["ColOr2"].ColumnName;
}
|
|
|
|
|
1.What is the equivalent settings for option strict on and option explicit on in c# ?
2.I have a class in another project ( VC++). I want to access the methods and properties in VC++ class from my project in C#. The VC++ is a standalone EXE project and hence I cant add any
reference to my project. But in VB I found a method named GetObject( "AssemblyName") to retrieve the object in runtime. As VB.Net supports early binding by setting option explicit ON , the
methods and properties of the VC++ class can be accessed by creating an instance of system.object. Can anyone please tell me how can we do the same in C#.net ?
3.Is there any C# equivalent function for "ON ERROR RESUME NEXT" in VB ? We can use Try catch but catch block will be excuted if any error occur in try block.
|
|
|
|
|
BINOVAR wrote: 1.What is the equivalent settings for option strict on and option explicit on in c# ?
There isn't one. These constraints are always enforced and cannot be disabled.
BINOVAR wrote: 2.I have a class in another project ( VC++). I want to access the methods and properties in VC++ class from my project in C#. The VC++ is a standalone EXE project and hence I cant add any
reference to my project. But in VB I found a method named GetObject( "AssemblyName") to retrieve the object in runtime. As VB.Net supports early binding by setting option explicit ON , the
methods and properties of the VC++ class can be accessed by creating an instance of system.object. Can anyone please tell me how can we do the same in C#.net ?
Look into p/invoke; I know you can access native dll's that way, I've never tried abusing an exe like that. Worst case would be writing a VB.net wrapper dll and calling that from C#.
BINOVAR wrote: 3.Is there any C# equivalent function for "ON ERROR RESUME NEXT" in VB ? We can use Try catch but catch block will be excuted if any error occur in try block.
No. And you shouldn't be using it in VB either unless you like corrupting your state and data.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
BINOVAR wrote: 3.Is there any C# equivalent function for "ON ERROR RESUME NEXT" in VB ? We can use Try catch but catch block will be excuted if any error occur in try block.
Someone will slap me for saying this, but you can also nest try catch blocks, and there's no requirement to have code inside the catch portion of the try block. At some point you will be causing the hari kari of whatever dev has to look at the code later though.
The true man wants two things: danger and play. For that reason he wants woman, as the most dangerous plaything.
|
|
|
|
|
Skymir wrote: Someone will slap me for saying this
You know already it is a bad thing. You obviously don't need someone to tell you. I've just had my dinner and not feeling energetic enough to slap anyone so, if you don't mind, could you do it yourself.
|
|
|
|
|
No worries, I forgot what I'm picking up at the store on the way home tonight. The wife will take care of the slapping.
The true man wants two things: danger and play. For that reason he wants woman, as the most dangerous plaything.
|
|
|
|
|
BINOVAR wrote: We can use Try catch but catch block will be excuted if any error occur in try block.
If I find out you have written a try-catch-ignore block I will reprogram your software with a large and very blunt axe.
|
|
|
|
|
Hello guys , i want to split a string but also save the delimiters in the resulting string array . How can i do that (if i can) ?
thank you !
|
|
|
|
|
How far you have done until now?
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
string[] small = matrix.Split(new char[] { ' ', '<', '>' });
it just saves the strings between the delimiters ,but i want them too ( if i had only one delimitor , that wouldn't have been a problem, but i have 3 of them and i want them in the exact order )
|
|
|
|
|
I'd suggest writing your own split function. Easy enough to do, use a StringBuilder and add each character one by one. If its one of your delimiters, add the string so far to the list and start again with an empty one.
Regards,
Rob Philpott.
|
|
|
|