|
Maybe somebody has experience with WCF and can share knowledge .
I need to use WCF on server side and rich client application with grid .
The question is how to send a lot of data to grid with the best performance.
Do you have any idea ?
sebwaks@yahoo.co.uk
|
|
|
|
|
Hi I am working with DatagridView and List<>:
my code goes as follows
List<seatentity> seat = scs.GetSeats();//Returns List<>
SeatEntity seobj= new SeatEntity();
foreach (DataGridViewRow row in dataGridView1.Rows)
{
foreach (DataGridViewCell cell in row.Cells)
{
foreach (SeatEntity se in seat)
{
seobj.SeatId = se.SeatId.ToString();
seobj.RowId = se.RowId.ToString();
if (cell.ColumnIndex.ToString() == seobj.SeatId.Substring(14) && cell.RowIndex.ToString() == seobj.RowId.Substring(12))
{
cell.Style.BackColor = Color.Green;
//MessageBox.Show(cell.ColumnIndex.ToString());
//MessageBox.Show(cell.RowIndex.ToString());
}
}
}
}
While I execute this code the out put is First row of the datagrid only....
But requirement is It should give more rows....
Help me.....
|
|
|
|
|
I think you are trying to work with a generic List<> but your code doesn't show that. This line:
List seat = scs.GetSeats();//Returns List<>
Would need to be defined as
List<seatentity> seat = scs.GetSeats();
And scs.GetSeats() should return List<seatentity>
So that is my guess as to why your code isn't working.
Ben
|
|
|
|
|
Hi
In a database I have 5 related tables, so that, in my project I'm working with 5 tableadapters inside a dataset.
The problem is: How can I update those tables using a transaction? I already googled but couldn't find an answer.
|
|
|
|
|
Hi all,
I have a Windows application developped using C#.Net with .Net 2005. I have used a datagridview in it. That gridview is allowing its contents to be changed its cells are editable. When a button is clicked, a cell in the gridview is selected. This is how happeneing till now.
My clients requirement is, when that button is clicked apart from the cell is being selected, cursor must also be placed on the text of the cell, for user friendlyness. Pls. help me I will be thankfull to you.
The code that I am using to select a cell in the gridview :
dgvLasers.EditingPanel.Visible = true;
bEdit = true;
dgvLasers.SelectionMode = DataGridViewSelectionMode.CellSelect;
dgvLasers.Rows[intIndex].Cells[1].Selected = true;
Regards,
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
I am trying to use following regular expression to parse strings:
Strings I try to parse are for example:
My regexp should match all strings above.
Name can contain one underline character (_) but not two sequential characters (__).
Parameters start with first #-character and end to }-character.
If there isn't any parameters my regexp goes mad and takes next next line to <name>.
How I have to change my regexp so <name> doesn't allow double _-characters ?
|
|
|
|
|
This should do it:
//\s*{\s*__(?<name>.*(?=__))__\s*(?<parameters>\x23[^}]*)*}
|
|
|
|
|
|
Try the following. I put your two expressions into my Regex editor (http://www.radsoftware.com.au/regexdesigner/) and started playing around till I found the following to work.
\s*{\s*__(?<name>[^ ]+)__(\s*(?<parameters>#[^}]*)})?
It works because the second part of the expression (\s*(?<parameters>#[^}]*)})? is now in an un-named optional group. Your first example, // {__NAME1__} didn't match the second part of your expression, so it failed. The other two examples matched, so they came back. This will result in an extra group being returned, but you can ignore it when you go through your matches by using the group names.
Hope this helps.
Hogan
|
|
|
|
|
Hi,
I would like to know if there is any method in .NET that can gurantee that when I use it the data will be saved to disk.
e.g.
for(int i = 0; i < 5000; i++)
{
StreamWriter myStream = new StreamWriter("test.txt");
myStream.WriteLine(i);
myStream.Close();
}
This does not provide that guarantee, if power is cut during the saving of no. 2500, so many numbers will be missing and only blank lines are inserted in the file.
Even using the .Flush() method does not provide this feature.
I found one method that calls a function from Kernel32.dll using [DllImport], but that makes the i/o operation too slow, and that too without a perfect guarantee.
Please help.
|
|
|
|
|
There is no method at all that will guarantee that all of your data will get saved to the disk if the power is pulled halfway through the save operation. How could it? If you haven't finished writing it out, there's nothing that you can do.
BTW - your example will cause you problems. You open and close the stream through each iteration of the loop.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi,
I have a number of SQL Server Express editions those are running on the same network. I want to synchronize the data on each instance with other instances on the network. The problem is that Full/Enterprise version of SQL Server is not allowed. Does anybody have any idea on how to do it? Any suggestion, component etc.
Regards,
Wasif Ehsan.
|
|
|
|
|
Hi there. I am experiencing timeout:
System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, TdsParserState state)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
at System.Data.SqlClient.TdsParser.ReadNetlib(Int32 bytesExpected)
at System.Data.SqlClient.TdsParser.ReadBuffer()
at System.Data.SqlClient.TdsParser.ReadByteArray(Byte[] buff, Int32 offset, Int32 len)
at System.Data.SqlClient.TdsParser.ReadEncodingChar(Int32 length, Encoding encoding)
at System.Data.SqlClient.TdsParser.ReadSqlValue(_SqlMetaData md, Int32 length)
at System.Data.SqlClient.TdsParser.ProcessRow(_SqlMetaData[] columns, Object[] buffer, Int32[] map, Boolean useSQLTypes)
at System.Data.SqlClient.SqlDataReader.PrepareSQLRecord(Int32 i)
at System.Data.SqlClient.SqlDataReader.GetSqlInt32(Int32 i)
at System.Data.SqlClient.SqlDataReader.GetInt32(Int32 i)
The problem is that the exception is thrown when trying to get a field from the 8th row, 1st column. The command was executed successfully, and the reader read 7 rows. I tried it several times, and the problem appears when I reach the 8th row, always.
Any ideas?
Thanks in advance.
|
|
|
|
|
then check timeout[^] of connectionstring
I Love SQL
|
|
|
|
|
In the SqlCommand object there is a property called CommandTimeout. There is a good chance you need to increase this number. The default is 30 seconds. So if you need more time then that increase this property so you don't timeout as soon.
Ben
|
|
|
|
|
10x Ben, but it's nothing to do with that. As I have pointed out this occurs always on the same row, after Executing the command. Which is odd. To my knowledge timeout has nothing to do with reading the dataset, but it throws Timeout exception.
My only guess is that maybe the exception message is wrong or the wrong exception s thrown.
10x anyway for your help.
|
|
|
|
|
|
When your application starts first time, create a file and store the started date inside that. For more security you can store that as encrypted. Read this file when ever your application starts. if it reaches more than 60 day's show expired message. Alternatively you can keep this in Windows registry also.
|
|
|
|
|
The program needs a way to tell that it's the first time it runs, though... Otherwise, the user could just delete the file or registry key, and the program would create a new one, practically giving you 60 more days of testing.
|
|
|
|
|
Hello
How do I create a project for .net 1.0, what I am using now is VS 2005. Can I convert and existing project to .net framework 1.0??
samuel
|
|
|
|
|
Not inside VS2005.
Well, you could create the code in VS2005 (i.e. just using it as a text editor) and as long as you only used .NET 1 methods, you could compile it using the cs command line compiler.
I do have a question though, why would you want to do this? .NET 2 provides a much better framework so it's hard to see why you would want to use a lesser version.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
well the WinCE 4.2 is stable only with .net 1.0 and with 2.0 there seems to be some issues, thanks I will try your method and see how it works
|
|
|
|
|
I am creating a menu control. It is having property called Items similar to ListItem . MenuItem class contains MenuName , MenuText , Image properties. User can add any number of menu items. So I created MenuItemCollection class which extends CollectionBase . It's having add method which accepts MenuItem class objects. Everything worked fine when adding from code behind. It looks like
MenuItemCollection MnuCollection = New MenuItemCollection();
MnuCollection.Add(MenuItemObject)
But problem started when I given collection class to the Items property to let user add menu items at design time, like what listbox do.VS Editor is showing collection at the Items Property. But when I click on Items, it opens collection editor also. But after clicking new it's simply showing System.Object . It's not showing any properties written in the MenuItem class. Can any one throw some light into this problem ? How I can create a collection class in user control and set that to the property, where user can add items at design time ?
|
|
|
|
|
If you are using .net >= 2.0 then I suggest you use a generic collection for your MenuItems:
public List<MenuItem> MenuItems
{
get { ... }
set { ... }
}
-^-^-^-^-^-
no risk no funk
|
|
|
|
|
Urs Enzler wrote: public List <MenuItem> MenuItems
Thanks, But I am not clear with this line, what do you mean by this ? By specifying <MenuItem> will this show properties in MenuItem class on CollectionEditor ?
|
|
|
|