|
Hi Giorgi,
i have to serialize a class that is derived class. and it has 3 class objects and 3 dataset proerties.
actually i am using serialization technique in .net 2005,i got the xml file but it contains xml schema file also. that comes in built at the time of serialization.is there any xml attributes or nay method is there to seperate or disable the xmlschema file with xml file.
can u please help me?
Thnaks
Raja
|
|
|
|
|
but that would not create problem of managed and unmanaged code...?
|
|
|
|
|
? has the forum put your post in the wrong place or have you just provided no information to really understand what your on about :P
Are you talking about converting VC++ code to C#?
Switching from programming in VC++ to C#?
Calling VC++ code from C#?
|
|
|
|
|
What I am trying to do is beable to type in to a textbox a password and then press Enter Button with that I would like to use my select statement of: "Select Count (*) As UserCount From UserName Where (Password = @Password)". This statement is in a sqldatasource and is connected to the control of the textbox on the form. I am however lost on how to continue to use the sqldatasource to tie up my enter button. I am just not sure how to use the sqldatasource in code to test for the query or even run the query. I have a example of the code I am writing if you would like to have it? I can email it to you. I would like to have to figure out some of this on my own so I dont want you to give me a complete answer right away. I want to and have to learn this!!!
Thank You
Allan
Allan F. Gagnon
|
|
|
|
|
Is this an ASP.net app or windows app? That would make a difference in how you try to capture the enter key press. Normally you will need a login button. So your enter key press would just click the button. Then with your sqldatasource you set up a parameter that is set based off your username and password.
If you are doing asp.net, I have written an article on catching the enter key press.
http://www.codeproject.com/useritems/EnterKeyToButtonClick.asp[^]
If this is a windows app then you will want to look at the keyPress event.
Hope that helps.
Ben
|
|
|
|
|
Hello friends,
I am looked for an answer all over the net and couldnt find:
I have a datagridview (VS 2005) with VirtualMode set to true. its DataSource is a DataTable.
I have some data bound columns (not auto generated), and I add one unbound column.
I tried to sort this unbound column in without any succeed:
I tried to call the sort function of the dgv but I get an error that this is not supported. (to sort by unbound column).
I also tried to catch the dgv SortCompare event and to make the sort by myself, but i understand that this event doesnt fired in VirtualMode.
Please help me...
thanks a lot
Tomer
Chupa Chupa
|
|
|
|
|
i need to know what type of object , and retrieve it from textbox.text
i mean , text = "Test" is string object
text = 123 is int object
Like
if (Textbox.Text is int?????? )
debug.write ("int")
else
debug.write ("String")
123
|
|
|
|
|
If you are obtaining the data from a textbox it will always be a string until you convert to something else.
int x;
if( int.TryParse(TextBox.Text, out x) )
debug.write("int");
only two letters away from being an asset
|
|
|
|
|
if you expect some type you can try converting or parsing Text property of the textbox..
example:
bool success = false;
int outVal;
success = int.TryParse(Textbox.Text, out outVal);
if(success)return outVal;
and so on with other types..
life is study!!!
|
|
|
|
|
Good afternoon, I'm investigating about the ScrollBar and I have found some info that could be interesting, using a VisualStyleRenderer
VisualStyleRenderer render = new VisualStyleRenderer(VisualStyleElement.ScrollBar.ThumbButtonVertical.Normal);
Rectangle thum_pos = render.GetBackgroundExtent(e.Graphics, vScrollBar1.Bounds);
Does anyone know how to get the Elements Position of a control using the VisualStyles and overpaint them?...
All info and links will be welcome.
Thanks everyone
|
|
|
|
|
Hello,
I am new to C# programming (day 1). I have created a list view object dynamically, and added 1000 items to it. Now I want to copy these objects to another list view, which wasn't dynamically created. But I do not see the contents to get coiped. The following is the corresponding code.
ListView lv = new ListView();
for (int i = 0; i < 1000; i++)
{
lv.Items.Add(new ListViewItem("Hi there"));
}
listView1 = lv; <font color=green>
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
you might need to call listView1.Refresh() after you assign lv to it
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
Actually, I tried that before posting it. That doesn't help.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
I thought that woulda worked (that or "Update()"). but it doesn't. When i debugged it i did see it get copied over though.
the only other thing that i can think of is something like this
ListView lv = new ListView();
lv.Items.Add(new ListViewItem("Hello"));
foreach (ListViewItem items in lv.Items)
{
ListViewItem lvItem = (ListViewItem)items.Clone();
listView1.Items.Add(lvItem);
}
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
Thanks, that works! But loading items in the ListView becomes real slow if the no. of items become huge.
teejayem wrote: When i debugged it i did see it get copied over though.
If it gets copied over, is there any way I could refresh the state of it somehow, so that it reflects it in the UI too?
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
Hi,
adding them one by one causes a recalculation of the layout every time.
There are two ways to avoid this speed trap:
- add a range of items
- suspend and resume layout
See the corresponding ListView methods.
|
|
|
|
|
Luc Pattyn wrote: There are two ways to avoid this speed trap:
- add a range of items
- suspend and resume layout
Thank you very much Luc Pattyn. I will look into it. The speed trap was the actual problem.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
Personally what i would have done is create a dataset object and go through each row of the dataset and add items to the listview if you'd like a snippet of that please let me know
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
Please give me a snippet. That would help me.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
DataSet ds = new DataSet();
ds.Tables.Add("Table 1");
ds.Tables[0].Columns.Add("Column 1");
ds.Tables[0].Rows.Add("Hello");
ds.Tables[0].Rows.Add("World");
foreach (DataRow row in ds.Tables[0].Rows)
listView1.Items.Add(row.ItemArray[0].ToString());
Hope this helps
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
What is that your trying to do? Why do you want to add it to one listview and again add it to another listview? You can use a listviewitem and add it to both the listview's if that is what your trying to do.
|
|
|
|
|
Tarakeshwar Reddy wrote: Why do you want to add it to one listview and again add it to another listview?
One is in the memory, and another is in the UI.
Tarakeshwar Reddy wrote: You can use a listviewitem and add it to both the listview's if that is what your trying to do.
No, I've added some items to a listview in the memory, and then I want all these items to be added to the one in the UI.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
brahmma wrote: No, I've added some items to a listview in the memory, and then I want all these items to be added to the one in the UI.
But why would you want to do that? Is there a specific reason you want to have the items in the memory? You will have to add 1000 items in the listview object in memory and again re-add 1000 items to the listview in the UI, thats almost like adding 2000 items and that would surely slow down the app.
|
|
|
|
|
Doing stuff in the memory is certainly faster. And I was testing with it and trying to find out if there is a function that would update the status of a control. (UpdateData() , in MFC does that in both directions, between a control and a member variable).
Tarakeshwar Reddy wrote: You will have to add 1000 items in the listview object in memory and again re-add 1000 items to the listview in the UI, thats almost like adding 2000 items and that would surely slow down the app.
You see, I was trying to find out if I could copy a listview object in memory to another.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
brahmma wrote: You see, I was trying to find out if I could copy a listview object in memory to another.
Yeah I did get that, but I am not sure if you can do that. You have an option to do an AddRange which would add a listview[], but I am not sure if that would be of any help to you either.
|
|
|
|