Click to See Complete Forum and Search --> : i have NO IDEA what i'm doing


savesheep
March 30th, 2009, 10:24 AM
Hey everyone!

Let me start off by saying I am not a programmer whatsoever. We had a group out of Egypt create a program for my office that runs off a MSSQL server. Just recently I had to migrate our server so the name changed. In doing so, our program is now looking at the old server since the connection string is hard-coded in the program. I installed C# 2008 express and went through changing all the connections to look at the new server (using find/replace) and when I click on publish/build/rebuild I get these errors:


Unable to resolve type 'ComponentFactory.Krypton.Navigator.KryptonNavigator, ComponentFactory.Krypton.Navigator, Version=2.5.1.0, Culture=neutral, PublicKeyToken=token'

The referenced component 'Microsoft.ReportViewer.Common' could not be found.

The referenced component 'Microsoft.ReportViewer.WinForms' could not be found.

The referenced component 'ComponentFactory.KryptonToolkit' could not be found.

The referenced component 'ComponentFactory.Krypton.Ribbon' could not be found.

The referenced component 'ComponentFactory.Krypton.Navigator' could not be found.

Ambiguity between method 'Microsoft.Office.Interop.Word._Application.Quit(ref object, ref object, ref object)' and non-method 'Microsoft.Office.Interop.Word.ApplicationEvents4_Event.Quit'. Using method group.


I downloaded the 30 day trial of Krypton and installed it just to see if I could publish but it still doesn't work. Just messing around I wound up right clicking on the 'references' folder and chose 'add reference' where I saw the four Krypton references. i chose all but the workspace since it doesn't seem to be needed by the application then chose OK. Yet it isn't working. I also posted this in the ComponentFactory forum for help with the Krypton errors but any help would be amazing.

Thanks!

P.S. - there is also a very good chance that this is not in the correct forum. please let me know if this is true!

nelo
March 30th, 2009, 11:53 AM
I installed C# 2008 express and went through changing all the connections to look at the new server (using find/replace) and when I click on publish/build/rebuild I get these errors:
You probably need to give a bit more information about the original codebase. Eg.
1. What version of the .NET framework was it targetting?
2. What version of Visual Studio was used?
3. What 3rd party libraries was it using?
4. Could you not get the original developers do the update? They might be able to do it for a small fee or as part of a service agreement. Also when they do it tell them that those settings should be available configuration files (i.e. instead of hard coding them).

savesheep
March 30th, 2009, 12:00 PM
1. What version of the .NET framework was it targetting?
2. What version of Visual Studio was used?
3. What 3rd party libraries was it using?
4. Could you not get the original developers do the update? They might be able to do it for a small fee or as part of a service agreement. Also when they do it tell them that those settings should be available configuration files (i.e. instead of hard coding them).

1. I believe it uses 3.5 .NET
2. visual studio 2005 seems to be the program that was used as its the vb version that references those reportviewer dll's.
3. it used the krypton toolkit library
4. the original developers blackmailed us over this project and since they are in egypt, there wasn't much we could do.


I did find a hotfix to download the two MS dll's that I needed to reference. I also found the old install of krypton toolkit 2.5.1.0 which was used for development. I installed both of them went back to that 'add reference' window and they are all there but don't do anything when i choose 'add'.

Thanks!!

nelo
March 30th, 2009, 12:32 PM
Hi,

Is this a big application? I suggest you upload the entire codebase and any 3rd party libraries. People (myself included) might be willing to at least it get it build without any errors.

JonnyPoet
March 30th, 2009, 12:44 PM
...I installed both of them went back to that 'add reference' window and they are all there but don't do anything when i choose 'add'. I think this are dlls. Have you only copied the files to the new machine or did you also register them using regsvr32.exe ? IMHO you need to register them and they should be done to windows\system32

savesheep
March 30th, 2009, 12:51 PM
Hey Nelo,

Thanks for your response. The program when rar'd is about 30MB. The reason we have to rebuild it is the server has changed so a few references to server2 in the program need to be changed to mail for it to connect.

Since the program has all our server info/passwords/etc in it, i'm just a hair bit reluctant in putting it out there for someone else to build.

However, if you're up to it, I wouldn't mind sending it to just one person to attempt it. I'll PM you if you'd like.

On the flip side - I would like to learn a little bit myself so if there is any way you can point me in the general direction that would be fantastic!

I just installed visual studio 2008 and I'm trying to find a disc for 2005 just in case.

savesheep
March 30th, 2009, 12:52 PM
@JohnnyPoet:

i have not registered them yet - i assumed in command prompt i'll just browse to the folder where the dll's are located and do a 'regsvr32 file.dll' is that right?

Thanks!

JonnyPoet
March 30th, 2009, 04:02 PM
@JohnnyPoet:

i have not registered them yet - i assumed in command prompt i'll just browse to the folder where the dll's are located and do a 'regsvr32 file.dll' is that right?

Thanks!Best way is copying all the dlls to windws\system32 and then you can do as you wrote above. You will get a message about succeeding or if not, what has failed

JonnyPoet
March 30th, 2009, 04:11 PM
I just installed visual studio 2008 and I'm trying to find a disc for 2005 just in case.2008 can do all what 2005 could and just a bit more.
Is the program written in C# ? If you are not sure just show 10 lines of code anywhere in the program and IMHO we are able to tell you if it is C#or whatever.

When you tried to reference to the dlls what happened exactly. you opened the reference section of the program and searched for the dlls, and then? Have they beed added ? maybe you first need to delete old broken entries to that dlls or you can find copies of the dlls in the bin\debug or bin\release section of your code.

I'm not sure but maybe MS ReportViewer is part of Crystal Reports.?

savesheep
March 30th, 2009, 05:49 PM
string[] Favourites = Estimate.QueryDataBase("SELECT FolderName from tblFavourites", "FolderName");
foreach (string fav in Favourites)
{
if (!lstFav.Items.Contains(fav))
lstFav.Items.Add(fav);
}
app.Quit(ref Missing, ref Missing, ref Missing);

}

private void kryptonPage4_Click(object sender, EventArgs e)
{
GetRecentDocs();
}

private void lstFavourites_Click(object sender, EventArgs e)
{
GetRecentDocs();

I've narrowed it down to c# because i tried to open it in all the other versions of visual studio and none could view it, haha.

It doesn't seem that ReportViewer is part of crystal reports - see here:
http://support.microsoft.com/kb/933137

Right now I only get one error. I removed the other three krypton references and now I just have the ambiguity error.

Thanks!

savesheep
March 30th, 2009, 05:50 PM
Okay - I just re-added those three krypton dll's and now they work. Same with the other references. So it seems they had to be removed and re-referenced in order for the system to 'click'.

savesheep
March 30th, 2009, 05:53 PM
private void GetRecentDocs()
{
Microsoft.Office.Interop.Word.Application app = new ApplicationClass();
app.Visible = false;
for (int i = 1; i < app.RecentFiles.Count; i++)
{
string temp = app.RecentFiles[i].Path + @"\" + app.RecentFiles[i].Name;
if (temp.Contains(Program.JobFolderPath))
lstRecent.Items.Add(temp);
}

string[] Favourites = Estimate.QueryDataBase("SELECT FolderName from tblFavourites", "FolderName");
foreach (string fav in Favourites)
{
if (!lstFav.Items.Contains(fav))
lstFav.Items.Add(fav);
}
app.Quit(ref Missing, ref Missing, ref Missing);

}

the error is in that last line. app.Quit

nelo
March 31st, 2009, 06:43 AM
the error is in that last line. app.Quit


What's the actual error?

savesheep
March 31st, 2009, 07:51 AM
Hey Guys,

I actually got the program to successfully build last night. My only issue now is making it talk to the MSSQL server.

I've gone into the surface area configuration tool to enable remote connections via both tcp/ip and named pipes. I've started the SQL Browser as well.

I also logged into SQL Server Configuration Manager to make sure everything is enabled. In here I enabled the VIA under protocols for SQL Server 2005 Network Connections.

The firewall is disabled on this machine. My program will not connect to the mssql database as i'm getting the error saying connection refused.

"A network-related or instance-specific error occurred while establishing a connection to SQL Server. THe server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections."

SOO for some reason I can't connect to it. When I run netstat -a on the server I get hundreds of pages so I can't exactly see if port 1433 is listening. Is there another way to check? Is there a program I can download that specifically tests connections to MSSQL?

Last but not least - I have configured the router to push port 1433 to the local IP of the server.

When I telnet to the SBS 2008 machine on port 1433 it says it isn't open.

Thanks again!

nelo
March 31st, 2009, 08:21 AM
Hi,

Have you been able to double-check the connection string? There may be a problem there. Is it targetting the right database server instance and database name? Does it have the right credentials?

savesheep
March 31st, 2009, 08:25 AM
Hey Nelo!

I got it to work! There were three remaining steps to make the connection happen.

1) Check the port in SQL Server Confugruation manager/Protocols for SBSMONITORING/ TCP/IP /IP Addresses /IPAll - add 1433 to TCP port
2) Tell it to only allow remote connections using TCP/IP and not both Named Pipes.
3) Allow MSSQL 2005 to accept connections in mixed mode not just windows authentication. More can be found here: http://www.codeproject.com/KB/database/SQL_Server_2005_remote.aspx

You guys are incredible! Thanks again!!

nelo
March 31st, 2009, 05:09 PM
Hey Nelo!

I got it to work! There were three remaining steps to make the connection happen.

1) Check the port in SQL Server Confugruation manager/Protocols for SBSMONITORING/ TCP/IP /IP Addresses /IPAll - add 1433 to TCP port
2) Tell it to only allow remote connections using TCP/IP and not both Named Pipes.
3) Allow MSSQL 2005 to accept connections in mixed mode not just windows authentication. More can be found here: http://www.codeproject.com/KB/database/SQL_Server_2005_remote.aspx

You guys are incredible! Thanks again!!

Nah!!! You're the incredible one! From zero programming experience to working all that out is not easy. I don't know you if you would make a good programmer/developer but you sure are an excellent problem solver and researcher :)

JonnyPoet
March 31st, 2009, 06:58 PM
Congratulations ! :wave:
Its always great when it is possible to help someone and the help in the end is acknowledged too. :D