Strange concurrency error
Hi
I have a perfectly working vs 2003 winform data app. All the data access
code has been generated using the data adapter wizard and then pasted into
the app.
I had to add a new field in the backend access db which I did. I then
dragged the table to the dataset and deleted the old table from the dataset
it so the dataset can see the new field as well.
The problem is that when in update command code I add these two lines
Me.updcomCompanies.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Web_Enabled",
System.Data.OleDb.OleDbType.Boolean, 2, "Web_Enabled"))
and
Me.updcomCompanies.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Web_Enabled",
System.Data.OleDb.OleDbType.Boolean, 2,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte),
"Web_Enabled", System.Data.DataRowVersion.Original, Nothing))
I startgetting a data concurrency error on mydataadapter.update() method. I
know that there is no data concurrency problem as I am the only user testing
the app. Obviously the error is misleading. What can I do from here to fix
this problem?
Thanks
Regards Tag: Free online books on ASP.NET , XML and Web Services Tag: 109434
WPF v Windows Forms
Hello all,
I am just trying to get up to speed with WPF (and .Net 3.0 in general), and
trying to decide whether it is worth using WPF for a new business application
(job tracking) which will be used by small businesses on windows Pcs
(XP/Vista). Hope to have it
ready by late 2007.
The only reasons I can see to use WPF instead of WinForms are:
Built on direct X and not win32 subsystem for graphics rendering (but what
precisely is the benefit of that for a business app?)
XAML may be easier for designers (non coders);
Possibly can acheive a new look which Winforms cannot (but not sure what
that is - any examples?)
What other specific reasons should be taken into account?
Thanks Tag: Free online books on ASP.NET , XML and Web Services Tag: 109433
Combo box in DataGrid
Hello - when I create a datagrid and select the combobox as the column
type, the application won't allow me to type freeform text into the
combobox when the application is run. It will only allow me to select
items from the drop down list. As far as I can tell, a normal combobox
will let you select items from a list OR allow freeform text to be
entered. Not so on the datagrid.
Is this feature not available within a datagrid?
btw - Using VB.net 2005
Thanks in advance... Tag: Free online books on ASP.NET , XML and Web Services Tag: 109430
VS 2003, false data concurrency error
Hi
I have a vs 2003 winform data app. All the data access code has been
generated using the data adapter wizard and then pasted into the app. The
problem I have is that I am getting a data concurrency error on
mydataadapter.update() method. I know that there is no data concurrency
problem as I am the only user testing the app. Obviously the error is
misleading. What can I do from here to fix this problem?
Thanks
Regards Tag: Free online books on ASP.NET , XML and Web Services Tag: 109429
View - Controller Question for Windows Forms
I have an app that has a MainWindow with a menu and toolbar. On the form, I
have a SplitContainer with 2 vertical panels. The left hand side panel has
an Outlook navigator bar and the right hand side will hold user control
forms, which will change depending on which form the user wants to see, ex.
customer, invoice, inventory.
I have a controller class for each of the different forms,
CustomerController, InventoryController etc. All events will be passed to
the controller class by the view. Now the question that I have is which
view should receive the events from the menu, toolbar and navigator bar.
The MainWindow which is holding them, the panel that the navigator bar is in
or the user control which represents the form. Regardless of who gets the
messgage, it will get passed to the appropriate controller class.
I don't want to use CAB here but I believe that CAB is overkill for my app.
Bill Tag: Free online books on ASP.NET , XML and Web Services Tag: 109428
Visual Studio 2005 SP1, and Vista
Hello,
About a week ago, I upgraded my development laptop to Vista Ultimate
and Office 2007. After I reinstalled my Visual Studio 2005
Professional, I installed the VS 2005 SP1 update.
I still keep getting a message dialog box that states ...
Visual Studio 2005 SP1 requires and update for Windows Vista.
I have run the OS update manually, and reinstalled the SP1 and I am
still getting the error message. VS2005 seems to work fine, but I just
hate ignoring error messages (I like a clean running system).
I could just remove the check mark on the Always show this message so
I never see it again .. but before I do, I want to make sure that I am
not missing something.
Anyone have simular problems? Tag: Free online books on ASP.NET , XML and Web Services Tag: 109425
ClickOnce and Basic Authentication
We have a "ClickOnce" application that we are attempting to deploy. The
application deploys correctly to the web server but when we attempt to down
load the application to the client it gives an error that indicates we
don't have the rights to it. We have traced it down to the fact that we are
using "Basic Authentication" because when we set IIS up as "Integrated
Authentication" the application downloads and installs properly.
Thanks,
Al Tag: Free online books on ASP.NET , XML and Web Services Tag: 109419
User Controls Help
I have been struggling with this for too long now, an desperately need help.
I'm an asp.net programmer, but am working on a windows form for this app. I
have 1 form and 2 user controls, Say UC(A) and UC(B). UC(A) has a datagrid,
UC(B) has a ListBox. When I click on the Datagridrow in UC(A) , the
Listbox in UC(B) should Update based upon an ID in the Datagrid, but It
wont. I have Tried using RaiseEvents first, then I tried just making a
Public Method, and then I tried a Public Property. The code in UC(B) is
Fired properly, and the Dataset is retreived from my DataClass, but When I
tell my listbox what the data source is, it wont rebind or redraw or
something. I also tried the declaring a public event in UC(A), and then
Delare UC(A) in UC(B) and setting a method to handle it. But that does not
work It fires the event, but nothing at all happens in UC(B).
What am I missing.
Tom Callahan Tag: Free online books on ASP.NET , XML and Web Services Tag: 109417
How to get the main window object from outside the object?
I'm pretty new to .net Windows Forms, but I've done a lot of searching
and can't find an answer to this question. Here's what I'm trying to
do:
main() {
Form1 myForm = new Form1();
Application::Run(myForm);
}
Function1()
{
// I need to modify elements of myForm either
// through a class function or by manipulating the
// object itself.
return;
}
Basically the app has the main window thread (Application::Run) and
then a listener thread for events coming in from other applications,
and those events need to manipulate the data being shown in the main
window.
Right now, I have hacked it up so that I have a static Form1 pointer
in the Form1 class, and whenever an event is received I do the
following:
Form1::thisForm->Function();
but, like I said, this feels like a hack.
Any suggestions as to the correct way of doing this would be greatly
appreciated. Thanks very much!
--Mike Tag: Free online books on ASP.NET , XML and Web Services Tag: 109415
auto close a messagebox on event firing, C#
Folks,
Im all too familiar with Messagebox.Show - but now I have a situation
where I need a similar sort of messagebox to appear, but to
automatically disappear when an event fires - ie, messagebox.show
("Please plug the device in the USB port"), then when the user plugs a
device in, and the device.connected event fires, the system
automatically kills the messagebox.
Any hints appreciated!
Cheers Tag: Free online books on ASP.NET , XML and Web Services Tag: 109410
problem when changing visibility of UserControl (VB.NET Windows Fo
Hi all,
.NET Framework 1.1 / Windows Forms - VB.NET
I have a wizard form and a user control with 2 listboxes on it (plus other
user controls for multiple dates and string values).
At runtime I create a new panel, then I instantiate the user control, pass
in an arraylist as the data source for the left-hand listbox, add the
usercontrol to the controls collection of the panel, and add the panel to the
form.
It all works fine, the arraylist is displayed in the left listbox, events
raised when the user clicks the button to add an item from the list on the
left to the list on the right... plus the panel hides itself ok to show
another panel with a different control when the user clicks Next.
The problem comes when I want to show again the Panel with the listbox
usercontrol on it after the user clicks 'Previous'.
An exception is thrown (cannot change the Items collection when the
DatSource property is set).
thing is, in the Previous method, there is nothing that would try to affect
the Items collection, so where is the error coming from?
thanks for any help
Philip Tag: Free online books on ASP.NET , XML and Web Services Tag: 109406
Is form visible to the eye
Hi all,
is there a way to determine whether a form is visible on screen or not. I
don't mean is it .Visible or .Hide() but can the user actually see the form
(be it focused or not)
For that matter can it be detemined exactly how much of the form is visible.
tia
paul Tag: Free online books on ASP.NET , XML and Web Services Tag: 109402
How to customize the form
Hi,
I am creating windows form at the run time and also i am setting the
FormBorderStyle to FixedSingle. So that the form comes with some standard
size, but i wanted to customize the form size.. How can i customize the form
size with FormBorderStyle property as FixedSingle.. Even when i tried with
setting form size to some less value but still it is coming with the standard
size,, Could you please help me out in this
Regards Tag: Free online books on ASP.NET , XML and Web Services Tag: 109401
XmlDocument.Load() crashes designer but works anyway?
The following code works when I debug and when I install the software
and run the .exe, but if I try to open the form in the designer (which
causes this code to run), I get an error:
Private Sub LoadTestSettings()
Dim rootPath As String
Dim eventHandler As ValidationEventHandler
rootPath = My.Application.Info.DirectoryPath
eventHandler = New ValidationEventHandler(AddressOf
XmlValidationEventHandler)
_xmlDocument = New XmlDocument()
_xmlDocument.Load(rootPath & "\" & "TestSettings.xml") '-->this is
where the error occurs<--
_xmlDocument.Schemas.Add("http://tempuri.org/TestXmlSchema.xsd",
rootPath & "\" & "TestXmlSchema.xsd")
_xmlDocument.Validate(eventHandler)
End Sub
If I try to open the form in the designer, I get this error:
Could not find file 'C:\Documents and Settings\DanThMan\Local Settings
\Application Data\Microsoft\VisualStudio\8.0\ProjectAssemblies
\gyyihrso01\TestSettings.xml'.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess
access, Int32 rights, Boolean useRights, FileShare share, Int32
bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String
msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess
access, FileShare share, Int32 bufferSize)
at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials
credentials)
at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role,
Type ofObjectToReturn)
at System.Xml.XmlTextReaderImpl.OpenUrlDelegate(Object xmlResolver)
at System.Threading.CompressedStack.runTryCode(Object userData)
at
System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode
code, CleanupCode backoutCode, Object userData)
at System.Threading.CompressedStack.Run(CompressedStack
compressedStack, ContextCallback callback, Object state)
at System.Xml.XmlTextReaderImpl.OpenUrl()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader,
Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at System.Xml.XmlDocument.Load(String filename)
at Test.DataManager.LoadTestSettings() in C:\Documents and Settings
\DanThMan\My Documents\Projects\Test\Development\App Code\Test\Test
\DataManager.vb:line 46
at Test.DataManager..ctor() in C:\Documents and Settings\DanThMan\My
Documents\Projects\Test\Development\App Code\Test\Test
\DataManager.vb:line 33
at Test.DataManager..cctor() in C:\Documents and Settings\DanThMan\My
Documents\Projects\Test\Development\App Code\Test\Test
\DataManager.vb:line 20
I can't figure out what to specify for the filename in
XmlDocument.Load(string fileName). Does
My.Application.Info.DirectoryPath not work if not in debug mode? If
not, what should I do to get the designer to open?
Thanks for your help,
-Dan Tag: Free online books on ASP.NET , XML and Web Services Tag: 109394
Menustrip combobox overrides..
I am using VB.NET 2.0, and I am having a trouble of time making the
menustrips combobox act how I want. What I am shooting for is instead
of the bland list box popping down when I click on the combobox I
would rather have it popdown with a data grid instead.
Is there any way of overwriting the list that comes with the drop down
box with a data grid?
Thanks! Tag: Free online books on ASP.NET , XML and Web Services Tag: 109392
Dynamic MenuStrip Question
Hi
With the following code, I can create a MenuStrip with one item, "Admins".
When the user clicks on Admins, it dynamically adds items to the menu
Admins. (In this case "Dave" And "Elizabeth")
When I run this form, the first time I click on "Admins", nothing happens.
Everytime I click on Admins after that I get the expected behavior.
Can someone tell me what I can do so that the menu item works properly the
first time?
Thanks
Dave Coate
Code:
Private MainMenu As MenuStrip
Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
MainMenu = New MenuStrip
'Add menu items to the Main Menu Strip
'The event handlers will populate each menu when the top level
'menu item is clicked
Me.MainMenu.Items.Add("Admins", Nothing, _
New System.EventHandler(AddressOf AdminsMenu_OnClick))
'Add the main menu to the controls collection of the form
Me.Controls.Add(MainMenu)
End Sub
Private Sub AdminsMenu_OnClick(ByVal sender As Object, ByVal e As
System.EventArgs)
Dim cms As New ContextMenuStrip()
Dim Admins() As String = {"Dave", "Elizabeth"}
For Each Admin As String In Admins
cms.Items.Add(Admin, Nothing, _
New System.EventHandler(AddressOf
SelectedAdminMenu_OnClick))
Next
Dim tsi As ToolStripMenuItem = CType(sender, ToolStripMenuItem)
tsi.DropDown = cms
End Sub
Private Sub SelectedAdminMenu_OnClick(ByVal sender As Object, ByVal e As
System.EventArgs)
End Sub Tag: Free online books on ASP.NET , XML and Web Services Tag: 109391
ClickOnce OnDemand Assemblies
I have written a winform app that splits out various pieces of
functionality into separate assemblies (Class Libraries). I deploy it
using ClickOnce. The main exe is marked Incude(Auto) and Required.
The various assemblies are marked Include(Auto) and split into File
Groups. All of the Class Libraries are referenced in the solution by
the exe project. After the File Group is asynchronously downloaded,
the latest version is not used. The previous version is used in its
place. If I synchronously download the assemblies, the same thing
happens. Any ideas???
Thanks!! Tag: Free online books on ASP.NET , XML and Web Services Tag: 109390
Removing TreeView nodes with custom images
Hi all,
Using VS 2005, and I have a problem with removing nodes with custom images
from a treeview.
TreeView's ImageList is initially empty. First, I add a default/root image:
treeView.ImageList.Images.Add("Tree_Root", new Bitmap(Resources.Tree_Root));
treeView.ImageKey = "Tree_Root";
treeView.SelectedImageKey= "Tree_Root";
When adding nodes, I create a custom bitmap (each node gets a different icon),
add it to the image list and assign node's ImageKey and SelectedImageKey:
Bitmap nodeBmp = new Bitmap(...);
// ... draw on bitmap ...
string imageKey = ... // create a unique image key
treeView.ImageList.Images.Add(imageKey, nodeBmp);
newNode.ImageKey = imageKey;
newNode.SelectedImageKey= imageKey;
...
// add the new node
treeView.Nodes[0].Nodes.Add(newNode);
This works fine. The problem occurs when removing one of these nodes that is
not the last:
TreeNode node = // get the node to be removed...
// remove the node from the tree
node.Remove();
// remove node image from the ImageList
treeView.ImageList.Images.RemoveByKey(node.ImageKey);
The problem is that after removing a node, nodes that were below it get their
images screwed up: unselected image for a node is ok, but selected image is
painted as next node's image (the last node's selected image is painted
blank). I have checked their ImageKey and SelectedImageKey properties, and
they're the same, as expected.
If I don't remove node icons from the ImageList, things work ok.
Any ideas?
Thank you,
--
Marko
ICQ: 5990814
I'm not under the alkafluence of inkahol
that some thinkle peep I am.
It's just the drunker I sit here the longer I get. Tag: Free online books on ASP.NET , XML and Web Services Tag: 109387
Problems with the Windows Forms Listbox (VB.NET 1.1)
Hi,
I have auser control with two listboxes on it. When the user selects one or
several items in the left box and clicks Add, they are copied into the
listbox on the right. When the user selects one or multiple items in the
listbox on the right (lstSelected) I want to remove the selected items.
I tried doing it like this (for one):
lstSelectedList.Items.Remove(lstSelectedList.SelectedIndex)
and it doesn't throw an error, but no items are removed.
What is wrong with my code?
Also, how do I code it so that if the user selects multiple items, they are
removed?
thanks
Philip Tag: Free online books on ASP.NET , XML and Web Services Tag: 109384
ReportViewer - accessing *second* object in object data source....
...grrrr - this is driving me mad !!!!!
I have a number of addresses to display on my report.
my object data source is an "Address" business object.
I can bind a collection (list) of address - and pass these into a
report for tabulation - no problem.
I can also access the frist address in the report using the "First"
operator.
......but I don't want to "tabulate" my addresses - I need to work
with them in a variety of ways and places.
I can find no way of getting at any other that the first address !
grrrr gnash gnash gnash
obviously if I invent some more "business objects" - eg:
HomeAddress
DeliveryAddress
....then those can be difference ObjectDataSources - and I could work
with those no problem. But I don't want my report to dictate my object
model.
note - if I invent a new class just for passing data to the report -
then I can find no way of accessing properties that are not "top
level"- e.g. I can't do: datasource.HomeAddress.Postcode.Value
any help appreciated....
O. Tag: Free online books on ASP.NET , XML and Web Services Tag: 109383
None of the KeyXXX events seem to be firing on my form :-(
Hi All,
I need to submit a form when the user presses enter. No problem I think
to myself - I'll just use the KeyDown event of the form. So I've added
an event handler for that event (and the other Key events) and
everything builds, but I can't seem to get the events to fire :-(
Can anyone think why this might happen? Am I supossed to do this sort of
thing in the Form's Key down event? I need the form to submit no matter
which control on the form has focus.
Many thanks to anyone who can help
Simon Tag: Free online books on ASP.NET , XML and Web Services Tag: 109379
what control to use
Hi all,
I have an application that has a form (MainForm) with a tabcontrol. I
want to populate the tabs (3 tabs) with other controls. I prefer to
put those controls (3 controls) in different classes since this allows
me to break up the UI in functional parts.
Momentarily I'm using usercontrols on each tab but this has it's
issues. Mainly the MainForm designer doesn't work anymore since I pass
parameters to the constructors of the usercontrols.
Someone can advice me another control?
Thanks
Stijn Tag: Free online books on ASP.NET , XML and Web Services Tag: 109376
VS 2005 images on toolstripbuttons & trees: do you use icons or pngs?
Hi all
In visual studio 2005 you can add images to toolstripbuttons, and I
was just wondering whether people used .ico files for this or .pngs?
Both support partial transparencies, and although the icon format
supports multiple sizes, I find that it just takes the biggest one and
resizes it badly.
Interestingly if you add an icon to your resources directly, it adds
it as an icon. However, if you select a tooltripbutton, change the
image property and then add an icon to the resources it adds it as an
image! Anyone know why this might be?
Anyway, I just thought I would see what the more 'correct' way was.
At the moment all mine are .ico files, but I think I will change them
to pngs. Tag: Free online books on ASP.NET , XML and Web Services Tag: 109372
help with where the item will be dropped during drag drop
Hi all,
Users can rearrange a listbox by a drag drop operation. All is
implemented but it's not always easy for the user to know where
exactly he is dropping his item. Does .net provide you with some sort
of functionality that indicates where you will drop your item?
Eg: when the user hovers between 2 items (Item3 and 4 here) a line
shows that it will be dropped between those 2 items. Can this be done?
Item1
Item2
item3
--------
Item4
Thanks,
Stijn Tag: Free online books on ASP.NET , XML and Web Services Tag: 109367
How to add pinned panels / user controls to the form
Hi all,
I want to create a user control like the Solution Explorer,
Properties window in the Visual Studio .net. How to make a panel /
user control auto hide using the pins.
Thanks,
Prashant. Tag: Free online books on ASP.NET , XML and Web Services Tag: 109362
How to add pinned panels / user controls to the form
Hi all,
I want to create a user control like the Solution Explorer,
Properties window in the Visual Studio .net. How to make a panel /
user control auto hide using the pins.
Thanks,
Prashant. Tag: Free online books on ASP.NET , XML and Web Services Tag: 109361
How to clone a "Control"
Does anyone know how to do this accurately. I really only want to clone the
design-time properties which should make the task easier. I've searched high
and low however and still can't find a problem-free solution. Even (ad-hoc)
solutions posted by MSFT employees have problems. For instance, if you
simply copy all serializable properties, you may eventually receive an
"Object does not match target type" exception. In my case, this occurs when
I encounter (and clone) the "Location" property due to the fact that the
"Site" property was cloned earlier. If I clone "Location" first however
(before "Site"), it works fine. There must be a clean way to do this. Can
anyone offer any insight. Thanks. Tag: Free online books on ASP.NET , XML and Web Services Tag: 109359
Vertical toolbar using toolstrips
I have a toolbar, which has text, that when moved from a horizontal
ToolStripPanel to a vertical ToolStripPanel will change the orientation of
the text so that it is written vertically. Though, I'm having a problem
with the layout.
When the strip is moved to a vertical panel, the text orientation is
changed, and the image position as well, but when it draws it to the screen,
it is much wider than it needs to be and not tall enough to contain all of
the toolstripitems, even though there is plenty of room to show them all.
(the extra items are moved to the overflow)
When I set the property CanOverflow to false, it makes the toolstrip the
correct width and height.
Has anyone else seen this issue and know if there is a way to get this to
properly draw with CanOverFlow set to true?
Thanks,
Jared Tag: Free online books on ASP.NET , XML and Web Services Tag: 109356
wpf book recommendation?
Any recommendations for WPF books? I'm a little skeptical of reviews on
Amazon right now, since they might be astroturfed by the publishers. Tag: Free online books on ASP.NET , XML and Web Services Tag: 109354
Data-bound DataGridView, overloaded ProcessCmdKey & CancelEdit problem
Hello, I need some help with a DataGridView control and ProcessCmdKey method of the form. The
DGV is data-bound to an Access database table with a few NOT NULL columns. The ProcessCmdKey
method of the form is overloaded. I tried to use
return base.ProcessCmdKey(ref msg, keyData);
in the overloaded ProcessCmdKey when Escape keypress was detected, hoping DGV will take care of
the edit cancelling itself, but this ends up in "Null not allowed in column ..." exception. Then
I tried to use
dataGridView.CancelEdit();
return true;
instead of above mentioned base.ProcessCmdKey(...). The same exception popped up.
Problem description:
1. DGV is empty, only one blank row is present
2. user starts editing of the first row of the DGV
3. user cancels editing of the first row while some if the NOT NULL columns are still not filled in
4. "Null not allowed in column ..." exception comes up
If there is at least one row already filled in, no "Not null ..." exception seems to be
appearing. Why? Has it something to do with the detached row created when user starts editing
the new row? If so, how do I remove it manually? Is it even possible?
I'm starting to be desperate... :(
Any ideas?
TIA
Pavel Tag: Free online books on ASP.NET , XML and Web Services Tag: 109353
problem getting data from drag drop
Hi all,
I have a 2 classes (A and B) inheriting from 1 base class (parent). I
populate a listbox with those 2 classes (A and B).
I want to implement some drag and drop ordering code on the listbox.
To get the data out of the dragged item I try:
Parent myParent = (Parent)e.Data.GetData(typeof(Parent));
The myParent is always null. Debugging tells me that the Data is
filled with the correct data (either A or B). Someone has a clue what
I'm doing wrong?
Thanks
Stijn Tag: Free online books on ASP.NET , XML and Web Services Tag: 109346
Dataset and scalability issue
I am creating a winforms application. Drag and drop and VS 2005
automatically created Dataset based on the MDB schema. I found it seems
that all the changes are cached in the memory. Will the default way has
any scalability issue if the database tables are huge? What's the
solution if it does have the issue? Tag: Free online books on ASP.NET , XML and Web Services Tag: 109342
Windows Form Dictionary
Hi All,
I want to make a dictionary with windows application. My data is html
format. therefore, i use webBrowser control on my windows form. If the
user click any word in webBrowser control, word mean must browse to
user (like babylon).
I have a windows form. My form has webBrowser control. I fill a html
content with javascript (Dictionary.js) to webBrowser.
Javascript (dictionary.js) can obtain the word if user double click on
the word.
I must to send this word another windows form. Thus, i will learn this
word mean.
My question is; Can the javascript call the windows form server code ?
if it can not, how can i do that?
Thanks any suggestion.
=D6znur Tag: Free online books on ASP.NET , XML and Web Services Tag: 109335
popup a form remotely
I am doing a simple chat server using .net remoting. When client
application in my system gets a message, i call a method which creates
a new object of a form to display message..The problem is i cant call
Show method or Showdialog.
if i call Show method, the form is not being displayed.
if i call showdialog the form gets displayed, but the form which i
used to send message to this app gets stuck..
i tried invoke method.that failed.anyways invokerequird is always
false in my case as am creating new object of form in the method which
gets called remotely..
any help pls.. Tag: Free online books on ASP.NET , XML and Web Services Tag: 109329
Developing a WYSIWYG - IDE type application. How would you do it?
Hi all
I have been asked to develop a solution that is customisable by our clients.
It is supposed to run on the Windows Mobile 5.0 CF2.0 environment using
Merge Replication.
I have looked into allowing the creation of Addin's but that has been
rejected as it would require to much programming knowledge of a Dot.Net
Language.
Ideally what I would like is to store the user interfaces and logical code
in a Database and then almost compile it at runtime to display the screens
and perform logical tasks.
Then build a WYSIWYG designer for creating the PDA entry screens that can
then almost be data bound.
What I am looking for is something like how an MS Access Database does where
you can do simple data bound screens or you can get into the thick of it and
write VB code.
My questions are:
1.. How do I store logical code in the database and then us it at runtime?
2.. Any ideas about how to build a WYSIWYG designer with a code editing
window?
If you know of any examples that would lead me in the right direction I
would be most great full.
The primary language I want to use for development is C#.
Thanks for any help.
ink Tag: Free online books on ASP.NET , XML and Web Services Tag: 109324
Localization issue...
Hi all,
I have been searching this group for an answer, but all responses
seems lead to the same conclusion as I would expect. So even if my
small resource-test is made up of code snippets from the
documentation, I'm still not getting the result I expect.
Here's the setup:
In my windows forms project I have the following files:
Application top node
- Resources (folder)
--- Labels.resources (made with resgen from resx, build action is
"Embedded resource")
--- Labes.en.resources (made with resgen from resx, build action is
"Embedded resource")
I try to access these resources in the following manner:
Thread.CurrentThread.CurrentUICulture = new CultureInfo("en");
ResourceManager rm;
rm = new ResourceManager("[toplevel namespace].Resources.Labels",
this.GetType().Assembly);
MessageBox.Show(rm.GetString("gnu"));
But whether I set the CurrentUICulture or not, the result is the same.
I only get the specified string from Labels.resources. I would expect
the code above to give me the string defined in Labels.en.resources. I
have also tried with a more specific UI culture (en-US), but the
result is the same...
Am I missing something?
Thanks in advance!
Christer Tag: Free online books on ASP.NET , XML and Web Services Tag: 109321
MouseLeave event not firing all the time
Hi,
Straightforward code posted below. Problem is that the MouseLeave event
sometimes does not fire. Strangly, it seems to be more often when moving the
mouse slowly away from the label (control "lblMin" is a label). Any ideas?
Thanks
Paul
Private Sub lblMin_MouseEnter(ByVal sender As Object, ByVal e As
System.EventArgs) Handles lblMin.MouseEnter
Me.SuspendLayout()
With lblMin
.BackColor = Color.Salmon
.BorderStyle = BorderStyle.Fixed3D
.ImageAlign = ContentAlignment.MiddleCenter
End With
Me.ResumeLayout()
End Sub
Private Sub lblMin_MouseLeave(ByVal sender As Object, ByVal e As
System.EventArgs) Handles lblMin.MouseLeave
Me.SuspendLayout()
With lblMin
.BackColor = Color.IndianRed
.BorderStyle = BorderStyle.None
.Image = Nothing
End With
Me.ResumeLayout()
End Sub Tag: Free online books on ASP.NET , XML and Web Services Tag: 109320
Prompt if save modified data when close form?
I have a data entry form with bindingsource and tableadapter (Access MDB).
How to detect if there is any unsaved modification when closing the form?
thanks Tag: Free online books on ASP.NET , XML and Web Services Tag: 109315
DataGridView Bound ComboBoxColumn cell take several seconds to show edit control
I am binding a custom object list (custom collection) to a ComboBox
column inside a DataGridView to use as a typical lookup.
The list of items has up to 10,000 rows (8,000 currently) and when you
enter edit mode on the combobox cell you must wait up to 4 seconds to
see the dropdown of the list of items. I am handling the
EditingControlShowing and the EditingControl KeyDown events to
dropdown the ComBox when the user hits Enter. This wait also happens
if you click on the ComboBox dropdown arrow.
I understand that may be a lot of objects, but 4 seconds is an awfully
long pause for the user. I am looking for some ways to cut this down
to 1-2 seconds at least but still use the custom object binding.
The binding is done on Form load and the only thing I can think of is
that it is reloading the control every time the edit control is shown,
which is why it takes so long.
Does anyone know of a way to debug what is going on at a low level?
As well, if anyone has any options or has had this problem and figured
it out, please reply.
Thanks! Tag: Free online books on ASP.NET , XML and Web Services Tag: 109314
Application.ExecutablePath does't work in Vista
Hi.
I have a Windows Forms application developed in .NET Framework 1.1.
The Application.ExecutablePath() function does not return correctly the
application path if the path or the EXE filename contains non-english
characters (like "c:\aplicación\aplicación.exe), but only in Windows Vista
(in 2000, XP or 2003 it works correctly). These characters are replaced by a
squared char (and the returned string is not usable in FileInfo, for example).
However, the Application.StartupPath() function works well in Vista and does
not return strange characters, making possible to solve the problem if you
have full access to the source code of the application and the ability to
recompile it. My application have many versions and I can't recompile and
distribute each one.
I think there is an issue with the .NET Framework and Vista. In my opinion,
the only way to fix it without changing and recompiling the application, is
patching the Framework itself.
Anyone knows if there is a KB article about this? Thank you in advance.
Regards,
Dani Tag: Free online books on ASP.NET , XML and Web Services Tag: 109302
One form, multiple panels
I have an explorer type application with navigation on the left half of the
form and a viewing/details panel on the right. The right panel can show
different content types based on what is clicked in the left side.
What is the best way to organize this code. Should each panel/content type
be a partial class in the main form? Or should I create a custom control
for each panel/content type? The custom controls aren't very designer
friendly and the partial classes aren't the cleanest approach.
Thanks. Tag: Free online books on ASP.NET , XML and Web Services Tag: 109292
Set MySettings for multiple records in one setting
Is there a way to have and set a setting in MySettings, so that it can have
mulitple entries, much like a Most Recently Used list? Tag: Free online books on ASP.NET , XML and Web Services Tag: 109290
Being theme-friendly
Does anyone have a link to a good reference on using the Theme API? Here's
what I'm trying to do:
I'm modifying a project I got off of CodeProject. It's a collapsible group
box. This control has a standard plus/minus graphic, but it's always a
simple black-and-white image. That's fine for people like me who run
Classic, but it wouldn't look right for Luna or most anything else. So I
want to be a good citizen and draw the themed expand/collapse images. I have
determined that they are the TVP_GLYPH part with the GLPS_CLOSED and
GLPS_OPENED states, but I don't know how to go about drawing them. Would it
be DrawThemeIcon()? If so, how do I use it? Language isn't important; I can
read both VB.NET and C#. Tag: Free online books on ASP.NET , XML and Web Services Tag: 109289
Enlarge the screen
Is possible to upgrade their workstations to Internet Explorer 7? If so,
they can then zoom what is in the browser window. Works really well.
Everything is zoomed: fonts, pictures.. Tag: Free online books on ASP.NET , XML and Web Services Tag: 109288
How to do Listboxes with master detail and default selection
Hello NG,
I am despairing, please help me.
With VS2005 i drag 2 Listboxes on my form and a bindingsource.
Listbox1 is bind to a bindingSource1.DataSource = data
Listbox2 is bind to a Listbox2.DataSource = subItemsBindingSource
all work as expected. When i select a item in listBox1, listbox2 display the details.
In the next step i implement
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
if (listBox1.SelectedIndex >= 0)
listBox2.SelectedValue = _data[listBox1.SelectedIndex].SelectedSubItem.Name;
}
to select a default value for listbox 2. Fine.
Trouble starts when i try to record the changes of listbox2 with
private void listBox2_SelectedValueChanged(object sender, EventArgs e)
{
if (listBox2.SelectedIndex > 0)
_data[listBox1.SelectedIndex].SubItemName = (string)listBox2.SelectedValue;
}
What is the right / advised way to implement such a behaviour ?
Please Help.
----------------------
public class data
{
private string _name;
private string _subItemName;
private subData _selectedSubItem;
private List<subData> _subItems;
public string Name { get { return _name; } set { _name = value; } }
public string SubItemName { get { return _subItemName; } set { _subItemName = value; } }
public List<subData> SubItems { get { return _subItems; } set { _subItems = value; } }
public subData SelectedSubItem { get { return _selectedSubItem; } set { _selectedSubItem = value; } }
}
public class subData
{
private string _name;
public string Name { get { return _name; } set { _name = value; } }
public subData(string n) { _name = n; }
}
public partial class Form1 : Form
{
public data[] _data;
public Form1()
{
InitializeComponent();
_data = new data[] {new data(), new data(), new data() };
_data[0].Name = "first";
_data[0].SubItemName = "first_2";
_data[0].SubItems = new List<subData>(new subData[] { new subData("first_1"), new subData("first_2"), new
subData("first_3") });
_data[0].SelectedSubItem = _data[0].SubItems[1];
_data[1].Name = "second";
_data[1].SubItemName = "second_3";
_data[1].SubItems = new List<subData>(new subData[] { new subData("second_1"), new subData("second_2"), new
subData("second_3") });
_data[1].SelectedSubItem = _data[1].SubItems[2];
_data[2].Name = "thhird";
_data[2].SubItemName = "thhird_2";
_data[2].SubItems = new List<subData>(new subData[] { new subData("thhird_1"), new subData("thhird_2"), new
subData("thhird_3") });
_data[2].SelectedSubItem = _data[2].SubItems[1];
bindingSource1.DataSource = _data;
}
}
----------------------
Kind regards
Uwe Tag: Free online books on ASP.NET , XML and Web Services Tag: 109276
Get Dialog to look like designer
In the windows forms designer my buttons have rounded edges and things in
general look good. However, when I run the application the windows form has
the old looking square buttons and the text and other controls don't look
like they do in the designer. Why? Tag: Free online books on ASP.NET , XML and Web Services Tag: 109275
Application Lost Focus when launch through Windows Explorer
Hi all,
I am working on an MDI application using VB.NET. Applications launches
normally either from Program Files or Desktop shortcut but some times
when it launches from Windows Explorer by going Program Files >
Application Folder > click Application Exe file, application lost
focus , minimized and starts flashes as windows caption.
I did use ParentForm.Activate() method to make application active but
no success.
Is there some other way to make application active as it is very hard
to find the issue as it was not happening regularly?
Thanks
Asif Tag: Free online books on ASP.NET , XML and Web Services Tag: 109272
can't drag usercontrol to a form
Hi all,
I have a usercontrol that doesn't contain a control. When I try to
drop the control on a form I get an error:
Failed to create component'TestcaseUserControl'. The error message
follows: 'System.NullReferenceException: Object reference not set to
an instance of an object.' at Line 20
Line 20 is: TestService m_service = new
TestService(ConfigurationManager.ConnectionStrings["connectionString"].ToString());
I also get compile warning:
- Exception has been thrown by the target of an invocation.
When I remove TestService m_service = new
TestService(ConfigurationManager.ConnectionStrings["connectionString"].ToString());
from the class it works.
Someone knows what's wrong?
Thanks
Stijn
public partial class TestCaseUserControl : UserControl
{
public TestCaseUserControl()
{
InitializeComponent();
TestService m_service = new
TestService(ConfigurationManager.ConnectionStrings["connectionString"].ToString());
}
} Tag: Free online books on ASP.NET , XML and Web Services Tag: 109266
Copying a Record from one DataTable to Another.
Hi All,
Was wondering if anybody could help. I'm currently trying to copy a record
from datatable to another. I have two problems:
1) Transferring the record from one datatable to another.
2) Transferring the record from the new datatable back to the database.
Any ideas?
Thanks
Gibbo Tag: Free online books on ASP.NET , XML and Web Services Tag: 109264
Free Online Books on ASP.NET, XML and Web Services
Get these links @ http://free-tech-ebooks.blogspot.com/2007/02/free-online-books-on-aspnet-xml-and-web.html