|
Hi,
I use an ArrayList to store class objects which have some public properties defined.
After adding objects to the ArrayList and binding the ArrayList to a datagrid I see all entries of the ArrayList and all public property fields of the class.
However, if I add further objects to the ArrayList or remove some, the datagrid is not updated at all. I have to reset the DataSource property and make a new databinding to see the current ArrayList content
e.g.
dataGrid1.DataSource = null;
dataGrid1.DataSource = myArrayList;
I am sure there is a better way to do that and I guess it has to do with implementing a certain interface, but everything I found so far was quite confusing.
Does anyone have simple example code showing how to do it ?
thanks
ch
|
|
|
|
|
There is a method on the DataGrid object called Refresh ().
Just call that in your code, and it should update the view.
In fact, there is a tutorial right here at the CodeProject, in which the author does something very similar to what you are doing (written for Managed C++ .NET).
http://www.codeproject.com/managedcpp/DataGridSampleMCpp.asp[^]
|
|
|
|
|
Hi guys,
I have created one pocket pc application in C#. I am using
windows pocket pc installation machanism to install the application to
the pocket pc. At the time of installation i am installing .NET
Compact Framework and SQL CE with my application using the
installation machanism.
I have tested it in windows 2000 server and Windows XP with
SP1, it is working fine. But when I tested in windows 2003 server and
windows XP with SP2, it won't able to install the application. What
can I do?. Anybody help me???
Thanks in advance....
Joji Perayil
|
|
|
|
|
Hello Developers,
I want to create a rotated font, and I use the following code to achieve this, like in this sample (http://winfx.msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_fxsamples/html/7c8b073b-5889-45e7-9a99-ebee39fe3b79.asp[^]), but using 1.1 framework.
Font CreateRotatedFont(int angle, Graphics g)
{
LOGFONT lf = new LOGFONT();
// scale a 12 point font for current screen DPI
lf.Height = (int)(-16f * g.DpiY / 96);
lf.Width = 0;
// rotation angle in tenths of degrees
lf.Escapement = angle * 10;
// Orientation == Escapement for mobile device OS
lf.Orientation = lf.Escapement;
lf.Weight = 0;
lf.Italic = 0;
lf.Underline = 0;
lf.StrikeOut = 0;
lf.CharSet = 0; //LogFontCharSet.Default;
lf.OutPrecision = 0;//LogFontPrecision.Default;
lf.ClipPrecision = 0;//LogFontClipPrecision.Default;
lf.Quality = 5;//LogFontQuality.ClearType;
lf.PitchAndFamily = 0;//LogFontPitchAndFamily.Default;
lf.FaceName = "Tahoma";
return System.Drawing.Font.FromLogFont(lf);
}
Am I doing something wrong in this code, or maybe someone did similar code once?
Thank you!
|
|
|
|
|
WinFX is user with .NET framework 2.0.
|
|
|
|
|
Hi,
I'm trying to work out the standard deviation of some numeric data in my form... but I can't see any way to call a StDev function. I've hunted high and low on the web and in the .Net help but I can't seem to find anything like this... can anybody make any suggestions as to how to do this?
TIA...
Mike
|
|
|
|
|
You can calculate StdDev is a simple loop.
1) Calculate the average of all values.
2) For each value X calculate DIFF = (X-AVG).
3) Square each DIFF value.
4) Sum the Squared DIFF values for the entire data set.
5) Divide the Sum of Squared DIFFs by (n-1) where n = number of values.
6) StdDev = Square Root of value calculated in Step 5.
Robert
|
|
|
|
|
Thanks so much for that - I really appreciate it... I'll give that a try when I get a chance to get back to that project.
Mike
|
|
|
|
|
G'day everyone,
I've tried to begin playing with smart device and pocket pc 2003 using VS .net 2003. I can begin a project, no problem, but when I try to debug, it comes up with an error...
One or more files from the Emulator for Windows CE installation is missing,
Please reinstall Emulator for Windows CE and try again.
Well, I've done that numerous times, even tried v 5.0 and 4.2, downloaded and installed just about every tool and sdk for the smartphone and pocket pc and still I get this error.
Im running VS 2003 and XP Pro.
Any ideas on how to get this to work would be great.
Cheers in advance.
Craig
|
|
|
|
|
Running XP SP2? Check this[^] out. Found just by typing the error messAge into Search box on MSDN.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I know this is fundamental question, but simply I am beginer in WindowsForms.
In VCL in DragDrop events there are Sender and Source, but in WindowsForms there is only Sender. How can I obtain a Source?
TIA
|
|
|
|
|
|
Ok, an example:
I have two ListBox (list1, list2). I'm preparing the drag&drop functionality for this list. I know the basic. First I must do that then that ... So I move item from list1 to list2. Sender point at list2 (I think). In VCL Source point at list1. Is there any pointer in WindowsForms like the Source in VCL? Of course I know I can make a variable and on begining of the d'n'd I can keep the source object in this variable. I wonder if there is "pretty" way to obtain a source object.
TIA
|
|
|
|
|
Well I'm not the d'n'd specialist. But as I see it, I would do the following:
In the OnItemDrag event of list1 you call DoDragDrop() . As the data parameter of DoDragDrop() you set the ListItem that the user is dragging.
In the OnDragDrop method of List2 you have the sender object as well as DragEventArgs .
Sender is List2. DragEventArgs has a property Data with a method GetData() to get the object you passed in the DoDragDrop() method as Data parameter.
And I think that is what you need. Because that is your ListItem the user is dragging from List1 to List2 and that you have to add to List2 now. What do you need a reference to List1 for in this situation, it should be sufficient to have the reference to your ListItem .
Claudio
Claudio's Website
Hommingberger Gepardenforelle
|
|
|
|
|
richTextBoxResult->Find(System::Convert::ToString(textBoxSearch->Text),RichTextBoxFinds::WholeWord);
labelSearchResult->Text = System::Convert::ToString(a);
richTextBoxResult->SelectionColor = Color::Red;
richTextBoxResult->SelectionFont = new System::Drawing::Font(S"Microsoft Sans Serif",8.25f,FontStyle::Bold);
------------
Above, richBoxResult colors only one matched word and changes to Red. However, I need to change the color to red in all my strings. How do I do that? It seems I need to loop the stmts above.
|
|
|
|
|
You do realize this is the C# Forum and not the C++ Forum, right?
[EDIT]
Whoops! My mistake! I just came from the C# Forum.
Your code only finds one occurance of the text. If you want to find more, you'll have to start the Find over again after the occurance you've already found.
Ask this in the Managed C++ Forum[^]...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello, I need help. Can anyone explain me how to create a zip filter to use with pocket pc and web services, bidirecional, since pocket pc does not support WSE 2.0 I can't use "Adding a zip filter to web services". Thanks
|
|
|
|
|
hi,
i want to use sqlserver mergemodule to install MS desktop engine,i've included the sqlsvr.msm into my deployment project
but i dont know how to pass install arguments such as password .if it is possible i would appriciate you helping me.
thanks.
|
|
|
|
|
Typically you set the userid and password when you build your database. In the VS.NET IDE add a textbox dialog and set up the properties to store the userid and password. Then configure the custom action that runs the script to create your database toi receive these property values and set the userid and password in your SQL script.
Robert
|
|
|
|
|
you are right but i want to set the password for "sa",during sqlserver installation from the setup file, i can determine the sa password and now i want to do so by merge modules.
thanks
|
|
|
|
|
I am not sure I understand why you would need to do this. You can run the built-in system stored procedure named sp_password to change the sa password from a script after a SQL Server is installed, so why would it matter if you set the sa password during the actual SQL Server installation itself, or if you set the sa password in a final custom action in the same package that installs the SQL Server?
The final result - setting the sa password - is the same in either case...???
In any case, a merge module is not a distinct physical entity in terms of an actual running setups. Merge modules cannot be "run" and do not exist as any sort of separate "setup". A Merge Module is nothing more than a set of Windows Installer tables and possibly CAB files. When you add a merge module to a Windows Installer package, what happens is the merge module tables are copied into the installer database along with any CAB files. The final result is a single MSI with additional table entries, not an MSI plus merge module components that are also run by the setup.
So you cannot change the behavior of a merge module by, for example, setting command line arguments.
The only way to change the behavior of a merge module is to manually author new functionality into the Windows Installer tables. Since a merge module becomes part of your final MSI, it does not make any difference if you change the merge module itself, or change your final MSI package after you've added the merge module. The net result is the same, because Windows Installer does not understand the concept of "running a merge module".
It would make more sense to change your final MSI package - which is essentially what I've already described: Add a dialog to collect the SQL Server parameters from the user interface and then run a script in a custom action that configures the SQL Server.
Robert
|
|
|
|
|
I am trying to do this application that when the form loads, a listbox fills with the users on the server/machine. I found a way to do it using a console, but I want to do it in a GUI. This is what I have so far.
NET_API_STATUS nas; //return code from NetMessage....()
LPBYTE buff; //buffer
MSG_INFO_0 *msg0; //message array info structs
DWORD handle, dwEnumCnt, dwEnumTot; //output from NetMessageNameEnum()
//get list of users on the server or machine
nas = NetMessageNameEnum(NULL, //use this server
0, //MSG_INFO_0 structures used
&buff, //*bufptr
256, //prefered max len of results
&dwEnumCnt, //LPDWORD etries read
&dwEnumTot, //LPDWORD total entries
&handle); //LPDWORD resume_handle
if(nas != NERR_Success)
{
MessageBox::Show(stderr);
}//end if
//display list in listbox
msg0 = (MSG_INFO_0*) buff;
for(i = 0; i < dwEnumCnt; i++)
{
userLbx->Items->Add(msg0[i]);
}//end for
I got that from some website, and changed the variables, but I keep get build errors, can anyone help? Thanks
|
|
|
|
|
Hi all, i have a pda application that uses SQLServerCE, and i would like to have wireless support for it so that i can use Remote data access to access SQLServer on a desktop terminal, and synchronise the data on the pda with the data on the desktop. I have a few questions here:
1)do i need any extra hardware or software on the desktop to enable for wireless connection?
2)In the code i have below, i left InternetUrl as blank as i'm not sure what i am supposed to put there. what is the parameter supposed to be? address of the desktop?
3)Is the code below sufficient for me to connect to the desktop database wirelessly?
Dim conn As String = "Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=admin;" & _
"Data Source=terminal;Packet Size=4096;Workstation ID=terminal;User Id=;Password="
Dim rda As SqlServerCe.SqlCeRemoteDataAccess = Nothing
Try
rda = New SqlServerCe.SqlCeRemoteDataAccess
'rda.internetUrl = "?"
rda.LocalConnectionString = "Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0;Data Source=\My Documents\test.sdf"
rda.Pull("admin", "Select * from admin", conn, RdaTrackOption.TrackingOnWithIndexes, "ErrorTable")
Catch err As SqlServerCe.SqlCeException
MessageBox.Show(err.Message)
Finally
rda.Dispose()
End Try
Thanks for looking at my post =)
|
|
|
|
|
SqlServerCE uses IIS (a web server) to bounce over to your SqlServer2000 server.
The connection string would be a URL to the IIS page. The page would query the server, and forward it back to the device.
See "SQL Server CE Database Development with the .NET Compact Framework" by Rob Tiffany
I JUST got a wireless ppc yesterday, so I'm eager to try this book out.
Top 10 Geek Resulutions:
5. To decipher what that big room is, which has the blue ceiling and poor climate control.
|
|
|
|
|
Hi, having trouble with .NET CAS configuration:
1. I want to add a Code Group with membership condition:
1.1 All applications running under "c:\inetpub\wwwroot\"
I tried doing this using dot-Net Framework Configuration Tool. To configure membership condition, there are various options: SPC, Hash, Strong Name, URL, site, zone, Application Dir... but nothing seems to suit this purpose. The closest thing I found is "Application Directory", but there's no place where you can specify the specific application directory desired.
1.2 I want to DENY file IO permission.
2. If my ASP.NET apps runs under a user acc, say, "MyAPPAcc" (by way of impersonation)... then ... What's the implication? The security privileges assigned by way of CAS applies? The resultant privilege that an ASP.NET app has is the intersection between:
a. privileges assigned to ASP.NET assembly (by CAS config)
b. privileges assigned to user account "MyAppAcc"?
Thanks in advance!
Norman Fung
|
|
|
|