|
Thanks about your Help
but i change it to :
cmd.CommandText = "Select MSA_ID,Client_ID,MSA_Effective_Date From MSA Where Client_ID="+cboClient_Name.SelectedValue+"";
but it give me the same error
please help
|
|
|
|
|
Ok, I haven't seen your code so I'm not sure if this is your problem, but it does sound like it is:
Whats probably happening is that u are databinding the second combobox in the form's contructor or in any other method that runs before the Load event and thus the second combobox's databinding is active when u start filling the first combobox. The Fill method is triggering ur probable SelectedIndexChanged event on ur first Cbo and thats whats causing the problem. U cant have that event happening while ur first dataset is filling. Your sqltextcommand will not build right because it cant read a loading datatable: thats why ur getting the error "The Column prefix 'System.Data' does not match with a table name or alias name used in the query". It's because SelectedValue is probably giving u the type of the ValueMember ("System.Data.DataViewManagerListItemTypeDescriptor") because it can't read anything else at that point.
Solutions:
Link the SelectedIndexChanged event manually in the LoadForm event handler (not through designer which links it in the constructor) , AFTER ur first cbobox code.
Best soltion: If ur sure that u only want the event to happen when a user commits a change in the first cbobox, then use the SelectionChangeCommitted event. U can link this one from the designer as it will only fire when a user changes the selected index. It wont fire with a code induced change.
Check and seee if this fixes the problem.
P.D. Recheck the code in ur second cbobox, ur databinding the wrong ComboBox....i think.
|
|
|
|
|
Hi Skynyrd ,
Thnaks your soultions working very good ...
i used SelectionChangeCommitted event
may you help me to understand why the selectedvalue dosnt work
regards
ha
|
|
|
|
|
I was wondering
is it possible to use a online database in a local application?
And yes how?
Is it also possible to use a My SQL database in a progam and again yes how?
Could someone help me please
im trying for months now
The_Underdog
|
|
|
|
|
The underdog wrote:
is it possible to use a online database in a local application?
What do you mean by "online database"? Surely a database has to be online in order to work? Do you mean "remote"? (as in on another machine). If so, then do you mean within the same network or across the internet?
The underdog wrote:
how?
Assuming you mean remote then the connection string will usually give the name of the server, or the location of the database. I would thing that file-bases databases (like Access) wouldn't work too well in the this scenario. But I've never tried other than a few connections in a LAN environment.
The underdog wrote:
Is it also possible to use a My SQL database in a progam and again [if] yes [then] how?
Yes, You can use the MySql Connector[^] for .NET. Or you can use the ODBC driver and connect via that.
Do you want to know more?
|
|
|
|
|
I am attempting to protype an application in C#. The program has three forms, in one of them (MapScr_Load) I want to call an initialization function from the form_load event handler. I put a breakpoint in the form_load handler but it is apparently never getting called. In a different form (ReadScr_Load) everything works as expected. Any ideas why this might be?
Phil Finlay
|
|
|
|
|
Are you only instancing a new MapScr_Load form? or are u calling its Show() or ShowDialog() methods?
Load events only happen just before a form pops up on screen and u have to call the Show() or ShowDialog() methods.
|
|
|
|
|
Thanks for your reply. I think I am doing things right. Here are the relevant lines of code:
// From the Settings_Scr.cs
:
:
private void GoToMapScreen_Click(object sender, System.EventArgs e)
{
MapScr MAPobj = new MapScr();
if (ESRImap.Checked) // a radio button
{
MAPobj.ESRIMap = true;
}
else
{
MAPobj.ESRIMap = false;
}
MAPobj.ShowDialog();
}
:
// From the MapScr.cs
:
:
this.Load += new System.EventHandler(this.MapScr_Load);
:
:
private void MapScr_Load(object sender, System.EventArgs e)
{
if (ESRIMap) // a breakpoint on this line never gets called
{
InitializeESRIMap();
}
else
{
InitializeMapPoint();
}
}
Phil F.
|
|
|
|
|
1. Does ur MapScr get to show onscreen when u run the app?
2. Where is the "this.Load += new System.EventHandler(this.MapScr_Load)" instruction located?
If its not in InitializeComponents() are u sure the constructor u are calling is running that method?
Try putting a breakpoint in that instruction and see if it ever gets called. Ur code seems perfect so the only logical explanation is that the instruction linking the eventhandler is not running somehow.
|
|
|
|
|
Thanks again for your reply.
MapScr does display.
"this.Load += new System.EventHandler(this.MapScr_Load)" is located in the InitializeComponents()and a breakpoint on it does stop the execution, but still no luck on executing MapScr_Load.
Since this is a prototype application I am going to put a button on the screen to display the appropriate map and try and figure out what is happening to MapScr_Load later when I have more time to devote to it.
Thanks again,
Phil Finlay
Phil Finlay
|
|
|
|
|
I have a rich text box, have set DetectUrls to true and have functionality on it's LinkClicked event, and everything works nicely for common types of url like http:// file:// ftp:// and so on
the problem is that it only seems to detect a certain built in set of protocols, whereas ideally I'd like to to be able to display [anything]://[anything else] as a clickable url
(The reason is we use alienbrain [similar to sourcesafe] which lets you copy/paste links to files in the database [ as alienbrain://path/to/file/in/database ] - office apps detect these as urls happily (so you can email links around to files) but I'd like my rich text control to be able to have the same such links
--
Help me! I'm turning into a grapefruit!
Phoenix Paint - back from DPaint's ashes!
|
|
|
|
|
Here's how I'd approach something like this
Give each cube a Visited property - set all of them to False initially
Create a member function something like this
Visit( target )
{
this.Visited = true;
if this == target
You've found a route through!
exit
endif
for each of the 6 neighbour
if neighbour.visited == false
if neighbour.filled == false
neighbour.Visit( target )
endif
endif
endfor
}
then assuming "Start" is the starting cube, and "End" is the ending cube, just call
Start.Visit( End )
As this looks like homework to me, I've written basic pseudocode, so you'll have to actually implement it yourself (and work out how to keep track of the successful route)
--
Help me! I'm turning into a grapefruit!
Phoenix Paint - back from DPaint's ashes!
|
|
|
|
|
NP. I prefer implementing this myself anyway.
And yepp, what you did should solve the problem: Keep track of the already visited cubes.
Darn
Cheers
Sid
|
|
|
|
|
Dear Sir,
I am thinking about how to use IPicture class using C#.
I am developing the tool using one component.
This component have a function to draw picture.
But this interface have IPicture.
I try to look for how to get IPicture.
If you know it, please tell me.
regards,
yu-yu
|
|
|
|
|
I am trying to create a table from inside the code of a windows application written in c#.
The table will be created in a .mdb file for example.
I found out a way using ADOX but the example was poorly written and i didn't understood much(and it s not working either.. ...)
So can anyone help me?
I thank u in advance.
|
|
|
|
|
If you've already got the database, you should be able to create a table using ADO and shouldn't need ADOX.
You can create a table by issuing a "create table ..." command to the database.
Store your favourite bookmarks online: my-faves.co.uk
|
|
|
|
|
Hi dear,
How can I retrieve a website name by its IP address
|
|
|
|
|
Connect to the Server (use the IP) on port 80.
Use HTTP_GET-Command to retrieve the website in /index.htm, /index.html, etc.
Then parse the html-code you receive between and for a line starting with <title> and ending with
That would then be the "Website Name".
Cheers
Sid
|
|
|
|
|
If you want its DNS name for the IP address, have a look at the
System.Net.Dns.GetHostByAddress() method
Store your favourite bookmarks online: my-faves.co.uk
|
|
|
|
|
Hi again,
I think my last post might have been a little too confused, so I thought I might just resubmit it.
I have generated a cube consisting of 20x20x20 smaller cubes. Each smaller cube may be filled or not, so there are "holes" in my big cube.
Now, starting on one side of the cube, I want to find a way through the big cube to the opposite side.
I wont bother you with cube generation details, lets just say I am using a 20x20x20 Array to simulate the cube.
I did smell recursion here, but I am a little confused on how to get started with this.
I thought I could maybe use the following "algorithm":
bool AmIPartOfTheWay(oldcoords, newcoords)
{
If (z == 19 && iAmAHole)
return true;
else if ((AmIPartOfTheWay(cubeaboveme) || AmIPartOfTheWay (cubeleftofme) ||
....... (for each cube, just not the one I came from) )
return true;
else return false;
But that always returns there is a way through the cube.
I have the feeling that I forgot something VERY simple, but I can't think clearly when everyone around is having a party
Cheers
Sid
|
|
|
|
|
sebs2004 wrote:
If (z == 19 && iAmAHole)
what's z ? do you want to go through the cube in just 20 steps?
How do you know you're not just looping through it without getting to the other side?
I think first of all you need some criteria characterizing your end cube.
there are no facts, only interpretations
|
|
|
|
|
Oh, sorry.
x,y,z are coordinates within my cube.
z is depth, so I am pretty much only testing for top-to-bottom connections.
I need to either rotate the cube or change the end conditions later in order to be able to test for connections from the 2 other angles.
so, z==19 (Array is 0..19) && isHole indicate that I have reached a "hole" on the opposite side, ending my search.
Cheers
Sid
|
|
|
|
|
ok, so this part I don't understand:
else if ((AmIPartOfTheWay(cubeaboveme) || AmIPartOfTheWay (cubeleftofme) ||
....... (for each cube, just not the one I came from) )
return true;
it seems that the cubes repeat calling each other endlessly.
say u have a big cube of 2X2X2, and all top 4 cubes are holes, the other 4 not. than the code above returns true cause each one of the top ones has a neighbor hole, right?;)
there are no facts, only interpretations
|
|
|
|
|
I have an mdi container form that contains a tab control down the left and when a tab is clicked it loads a form to fill the reaming area inside the mdi form. The problem I have is that when it loads you can see the form beign drawn and it looks aweful. Is there anyway that the form can be loaded without it showing each control being drawn?
|
|
|
|
|
Indeed you can
at the start of your code add
this.SuspendLayout()
..and after everything's done..
this.ResumeLayout(true)
--
Help me! I'm turning into a grapefruit!
Phoenix Paint - back from DPaint's ashes!
|
|
|
|