|
If I want to save in a variable the name of my actual file(name which i saved it before), how I can do that?
|
|
|
|
|
once u get the complete path get the the last index of "\" and then use substring just to get the file name and store in the variable
|
|
|
|
|
When filling a dataset with a table I use first FillSchema() and then Fill().
Here is my problem:
Table A has had say 1000 records in it. Those records have no been deleted before filling the dataset with Table B. So the next ID of an autofield would be 1001. Okay, but when I fill the dataset the Table A while Table A is in memory it has a starting ID of 0. So, now if I have Table A and Table B in a dataset and I am placing the ID from Table A into Table B as a FK, when the database is then updated with Table A and Table B. Table B will have false IDs for Table A.
How can you fill the dataset with Table A so that it the ID would be set to the next ID in the database would be? So that the IDs matched.
|
|
|
|
|
I found that for a SQL database using
SELECT IDENT_CURRENT('{owner}.{tablename}') AS '{whatever}';
will return the last used/inserted ID for that table. -Not the next ID but the current/last used ID.
Here is a link:
http://msdn2.microsoft.com/en-us/library/ms175098.aspx[^]
Still need to figure out a method for Access databases.
God Bless,
Jason
Programmer: A biological machine designed to convert caffeine into code. Developer: A person who develops working systems by writing and using software.
[ ^]
|
|
|
|
|
Hi,
Basicly, i'm creating a graphical based control that displays the relationships of different data types.
The way i currently do it is to go through 2 data types in a foreach loop, which gives me data that i can use to get other data type structs.
eg - not my code just abit pf pseudo example:
foreach (Node node in MainDataType1)
{
Struct structInfo = node.GetStruct();
Node dataType1 = CreateNode(node, structInfo);
Struct structInfo2 = node.GetStruct();
Node dataType2 = CreateNode(node, structInfo2);
Relationship rel = CreateRel(dataType1, dataType2);
}
The above code would create the "left hand side" of the model. I would then go through the 2nd main data type with the same format of code to create the "right hand side".
The problem is, i need to create objects that arnt related, eg if a relationship is lost between 2 data types for some reason, then i wont create the node, because the struct wont return me any information for it.
I've throught of going through all the data types and creating the nodes after i've done the 2 above peices of code, and checking to see if i've created that node.
eg:
foreach (Node node in MainDataType1)
{
foreach (Node node1 in GraphNodes)
{
If (node1 != node)
{
CreateNode();
}
}
}
The problem i see with the above code is it will be time consuming and not practical as i'm going through all the data types more than once which seems silly to me.
Any ideas?
Regards,
Gareth.
|
|
|
|
|
One approach could be to create a list that contains all of the nodes, and then everytime you add your related nodes you would remove them from this list. Whatever is left in the list is the missing nodes.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hello,
My new project is to write a Script Editor in C# using Visual Studio. The script editor should be similar to notepad, simple text editor, however, with this main features:
Syntax Highlighting (Example - http://img248.imageshack.us/img248/9230/untitledtd2.png)
Syntax Highlighting Rule:
// = A comment, anything after it shud be orange
*.gat = anything written with the extention .gat is a map name, so it shud be green
numbers = any numbers shud be colored blue
script = this text be colored red (optional)
set, mes, etc... = are script commands and shud be made bold
next, close = functions used to do something with chat window, shud be colored grey
"text" = anything inside " " should be colored brown as its text
Thats about it, one other feature if possible is this:
{ = on type and press enter, auto tab
How can i get started on writing something like this? Any idea, step up, guide on this project would be much appreciated. Thanks in advance for any help.
|
|
|
|
|
Get a copy of the ebook from the SharpDevelop team that tells you about the issues and challenges that they faced when writing SharpDevelop. It has plenty about the architecture and the decisions that they took, so it's a really good fit for your needs. Best of all, I believe that it's free.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thanks for the suggestions guys, i started to do some research while i was waiting for a reply and foundout about the great built-in highlighting feature in .NET
I'll post here if i come across any problem whilst using that. Thanks allot again~
|
|
|
|
|
Hi...
I have a picturebox and I want that when the user scroll the mouse, the Picture act like this.
I found some code>
MouseHelper mh=new MouseHelper(this);
mh.WheelBackward+=new MouseEventHandler(OnWheelBackward);
mh.WheelForward+=new MouseEventHandler(OnWheelForward);
But, what do I write inside this>
private void OnWheelBackward(object sender, MouseEventArgs e)
{
//???????
}
Waiting for help..
att..
("sorry for the bad english")
thanks...
|
|
|
|
|
The Brazilian One wrote: I have a picturebox and I want that when the user scroll the mouse, the Picture act like this.
You want the picture to do what?
|
|
|
|
|
I want that it scrolls on the screen... Up and Down...
Thanks..
Cheers
|
|
|
|
|
Let me explain...
I have a Panel and inside it, a PictureBox...
The Panel is set as "auto-scroll"...
I want that when the user scroll the mouse, the pic moves inside the panel..
well, that`s it...
=D
thanks all!
|
|
|
|
|
Put a panel on your form. Set it's AutoScroll property to true. Then place the picture box in there. When you set the image for the picture box, set the size of the picture box to the same size of the image. The scrollbars will appear automatically, and the mouse wheel should automatically scroll, no code required.
|
|
|
|
|
But the mouse wheel didn`t automatically scroll!!
=/
|
|
|
|
|
|
Application has encountered a problem and needs to close.
1. My code debugs and runs perfectly fine.
2. I publish my application to a shared file server.
3. I log on to the target machine and browse to the folder I published my application files.
4. I click the setup.exe
5. It begins verifying application requirements.
6. Are you sure u want to install this application dialog pops up - Install or Don't Install button
7. I click the install button.
8 Acts as if it begins to install then Error -
{APPLICATION NAME} has encountered a problem and needs to close. We are sorry for the inconvience..
9. Button that says Send Error Report and button that says Dont Send
10. Also hyperlink on form that says "What data does this error report contain"
11. If i click the link gives me some wierd information - keywords in the info below
Event Type: clr20r3 Mscorlib system.io.directorynotfound
It does not tell me what the problem is.
I am clueless. can somebody help me please.
1.0 and 2.0 .net framework installed on target machine.
Thanks in advance
Kourvoisier
|
|
|
|
|
It looks as though the directory it is attempting to install into doesn't exist.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
anyone have any ideas of what to do next. I am pretty much at a stand still at this point!!!
|
|
|
|
|
Between steps 3 and 4 do you drag setup.exe to the target machine? Or are you just clicking on it out of the file server?
If no: Perhaps your file server doesn't have .NET installed on it. It will not be able to locate the .NET CLR on the target machine.
Brent
Brent
|
|
|
|
|
I do not drag the setup.exe to the target machine. I simply click it str8 from the file server.
The .net framework is not installed on the file server.
Do you think this may be the problem?
I have published other .net applications to this server and installed on multiple target cpu's without any issue.
I do have a app.config file with a hardcoded file path. Do you think this could be the issue?
although i dont think may be the issue either.
below is my app.config
<?xml version="1.0" encoding="utf-8" ?><br />
<configuration><br />
<br />
<configSections><br />
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" ><br />
<section name="Navision_Add_On.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /><br />
</sectionGroup><br />
</configSections><br />
<appSettings><br />
<br />
<add key="WorkingDirectory" value="C:\Navision_Plug" /><br />
<br />
</appSettings><br />
<br />
</configuration>
|
|
|
|
|
I also get errors trying to run a .NET app from a file server. But I have always been able to drag the same executable to the desktop, double click it and it runs just fine. I would recommend you add this to your process.
Brent
|
|
|
|
|
Brent,
I drag the setup.exe to the desktop along with the other files that it needs double click on the target computer and the same exact error happens.
|
|
|
|
|
Application has encountered a problem and needs to close.
1. My code debugs and runs perfectly fine.
2. I publish my application to a shared file server.
3. I log on to the target machine and browse to the folder I published my application files.
4. I click the setup.exe
5. It begins verifying application requirements.
6. Are you sure u want to install this application dialog pops up - Install or Don't Install button
7. I click the install button.
8 Acts as if it begins to install then Error -
{APPLICATION NAME} has encountered a problem and needs to close. We are sorry for the inconvience..
9. Button that says Send Error Report and button that says Dont Send
10. Also hyperlink on form that says "What data does this error report contain"
11. If i click the link gives me some wierd information - keywords in the info below
Event Type: clr20r3 Mscorlib system.io.directorynotfound
It does not tell me what the problem is.
I am clueless. can somebody help me please.
Thanks in advance
Kourvoisier
|
|
|
|
|
Try reinstalling the .NET framework on the target machine.
|
|
|
|