|
How about Environment.NewLine ?
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
You can use Environment.Newline as mav suggested, or why not simply use File.ReadAllLines to read the file into an array of strings?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
I have a class that returns a dataset,
csServices GetDataServices = new csServices();
gvServices.DataSource = GetDataServices.ServicesDS;
gvServices.DataMember = "tbl_Services";
all im doing is reading data, dont need to update etc..
Although my dataset (ServicesDS) returns 1 table and 6 columns,
i dont need to show all the columns in my gridview(gvServices),
how can I only show the columns I specifiy ie "ID", "Name"?
Following on.. should I be ref to a dataset or datatable,
pros, cons?
thanks
|
|
|
|
|
You're not telling which GridView you're using, web control, WPF etc?
Anyway, most gridviews work in a way that if you don't add columns to it before you bind the data, all columns are added automatically. So you should create the necessary columns beforehand either in code or in designer.
|
|
|
|
|
|
If you're using DataGridView, then you could use for example DataGridViewColumnCollection.Add Method [^] to add desired column to the DataGridView before you bind the data (or add the columns in designer).
|
|
|
|
|
I use 2 methods
limit the columns selected from the database, this gets rid of useless columns
set the column. visible = false - this hides the columns that are required but do not need to be seen by the user (id column)
You can still access the data in a non visible column
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hello,
I'm trying to retrieve the columns from an Oracle 9i database using OdbcConnection class's getSchema method. While I can retrieve the tables and views just fine with getSchema("tables"), everytime I call getSchema("columns") I get a System.FormatException with message "Input string was not in a correct format".
I've tried various combinations of the schema string, such as "Columns", "COLUMNS", etc.
Thanks in advance.
Reference: http://msdn.microsoft.com/en-us/library/cc668760.aspx[^]
|
|
|
|
|
The GetSchema functionality depends on the ODBC driver. Are you using Microsoft's Oracle ODBC driver and if not, could you test GetSchema using that driver?
|
|
|
|
|
I was unable to configure Microsoft's ODBC Oracle driver successfully with the database, so I'm using Oracle's 9i driver. Thanks for the reply.
|
|
|
|
|
|
Mika,
Thanks for your suggestion about the driver; getSchema("columns") works fine with the Oracle database after I configure the connection using Microsoft's Oracle driver instead of Oracle's 9i driver.
There is one concern, though--will the future versions of Oracle database continue to work with Microsoft's driver?
Lastly, I'm still curious as to why getSchema("Tables") works with Oracle's driver but not getSchema("Columns").
Thanks.
|
|
|
|
|
Sorry for the late answer!
stilz wrote: will the future versions of Oracle database continue to work with Microsoft's driver?
Usually the will for a version or two. But if you upgrade the Microsofts driver when a newer Oracle version comes out, it usually supports new features better. However there's no quarantee for this, but that has been the situation for more thatn 10 years.
stilz wrote: Lastly, I'm still curious as to why getSchema("Tables") works with Oracle's driver but not getSchema
I would guess that Oracle simply hasn't implemented that. I think their main priority is to get people to use native connections, either System.Data.Oracle.OracleConnection (Microsoft's version) or Oracle.DataAccess.OracleConnection (Oracle's version).
|
|
|
|
|
How can i hide tooltip on properties when they are displayed through propertygrid.
Thanks
|
|
|
|
|
Hi everyone!
I'm working on a project and i need to do what follows:
i have an array of strings,example:
house3
house2
green23
green.5
H6
H01
G19
G78
..and so on.
I have to extract only the recurrent strings: house,green,H,G.
Any idea about it? (the language is java but doesn't matter, i just need the idea!)
Thanks in advance,
Enrico.
Program your life ^^
|
|
|
|
|
Lots of them but this looks like homework.
I imagine the Vector class is somewhere in your near future and use of the contains method.
Need custom software developed? I do C# development and consulting all over the United States.
If you don't ask questions the answers won't stand in your way.
Doing a job is like selecting a mule, you can't choose just the front half xor the back half so when you ask me to do a job don't expect me to do it half-assed.
|
|
|
|
|
Hi,
this would be my attempt:
- strip all redundant characters from each string, probably every non-letter;
- optionally: normalize the casing, say convert all strings to lower-case;
- collect the strings in a List<string>, however before adding them, check whether the new string
is already present; if so you found a duplicate.
(you can improve on this by using a Dictionary which holds the string as a key, and the occurence
count as an int value).
BTW: why ask for an algorithm in a language oriented forum that does not match your language?
we do have a "Math and algorithms" forum.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
modified on Friday, June 10, 2011 11:38 PM
|
|
|
|
|
Luc Pattyn wrote: BTW: why ask for an algorithm in a language oriented forum that does not match your language?
we do have a "Math and algorithms" forum.
Is not the forum called "Algorithms", I don't see "Math" there?
|
|
|
|
|
Ravadre wrote: Is not the forum called "Algorithms",
it has been called "Algorithms and Math", as well as "Math and algorithms" before.
However you are right, this week it is called "Algorithms".
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
modified on Friday, June 10, 2011 11:38 PM
|
|
|
|
|
try using regular expressions....using remove method.. removing pattern[0-9]
the quieter u become more u hear
|
|
|
|
|
great idea lawrenceinba! but what do you mean with "removing the pattern"?
i'm not sure to understand this way..
Program your life ^^
|
|
|
|
|
Hi,
I am a developing an webcrawler in c#. The crawler will take a url from the user and crawls through the page pointed by that url fetching the urls it can find from the page.This is a recurring activity and the output is a huge collection of strings/urls.
Please tell me which is the best holder for such a huge data. I considered access database but it makes the application slow since reading and writing is a frequent activity.
Thanks,
John.
|
|
|
|
|
you could try a StreamWriter straight to a file
If only MySelf.Visible was more than just a getter...
|
|
|
|
|
Well, I'm about to pull my hair out on this. So I figured I'd post for help before I cause some premature baldness.
I'm fairly new to C# and have run into this problem trying to get info out of a int byte that I get returned.
Here is what is stated in the lib that I'm working with:
The first three bits represent a single value, not flags.
For example Auction (0x05) is not a combination of OwnedByOther (0x01) and ForSale(0x04). However, the BorderWest and BorderSouth values are bit flags that get attached to the value stored in the first three bits. Bits four, five, and six are unused.
public enum OverlayType : byte
{ Public = 0,
OwnedByOther = 1,
OwnedByGroup = 2,
OwnedBySelf = 3,
ForSale = 4,
Auction = 5,
BorderWest = 64,
BorderSouth = 128
}
So where I'm lost is trying to get the first 3 bits out and get the enum OverlayType from them. Plus the BoarderWest & BorderSouth.
|
|
|
|
|
Im a bit confused as to what you are trying to do?
If only MySelf.Visible was more than just a getter...
|
|
|
|