Baran Posted May 14, 2011 Posted May 14, 2011 hi every one. I have two major problem with my windows server 2008 that I couldn't find any solution for them. MY first problem is: I've installed SQL server 2008 and ran an ASP.net Application (I have wrote the application) on IIS 6. For debugging the program also I have installed Visual studio 2010. While running the application on visual studio I have no problem to access my database on my SQL server but on the IIS my website can not access the data base. I have checked my Connection string and every thing which link my site to the data base server. Nothing is wrong with them. I thing the problem is with the firewall but I can't fix it !! and my second problem is: I've install MDaemon Mail server v9.5.2 on my windows server. while i'm accessing MDaemon World client on 192.168.0.35:3000 from my machine every thing is OK but in my local network (ofcourse it's obvious with no internet connectivity) i can't access the IP from another machine. also I think the problem is with my firewall but again I can't solve it. I need you help a lot. waiting for your solutions.... Quote
ICTCity Posted May 14, 2011 Posted May 14, 2011 hi there, Just to be sure your problem is the firewall, temporarly disable it and check both applications. If this resolve your problem, re-enable your FW and post again so we can investigate on your problem. If this doesn't help you in any way, post again for the same reason as before :) cheers Quote -------------------------------------------------------- Tu peux aussi crire en franais. Du kannst auch auf Deutsch schreiben. Puoi scrivere anche in italiano. --------------------------------------------------------
Baran Posted May 15, 2011 Author Posted May 15, 2011 Thank you very very much for your answer It worked!! but still I have problem with my sql server. My web site can not access my data base. And also I have another question: What if I turn my fire wall ON? How should I configure my firewall not to have problem with my MDaemon mail server and SQL server? Quote
ICTCity Posted May 15, 2011 Posted May 15, 2011 You have to open the rights ports on your FW: Because of the many different scenario you can have, I suggest you to read this article from MS, which explains not only HOW to configure (allow) a program with Win FW, but also the ports used by SQL. http://technet.microsoft.com/en-us/library/cc646023.aspx Regarding your other problem, I suggest you to try to add a simple ODBC connection and see if you can retrieve any info. Can you post the string you use to connect from your app? thanks. Quote -------------------------------------------------------- Tu peux aussi crire en franais. Du kannst auch auf Deutsch schreiben. Puoi scrivere anche in italiano. --------------------------------------------------------
Baran Posted May 16, 2011 Author Posted May 16, 2011 Thanks for the given topic I follow the solutions. I added two rule in my firewall. One for opening port 1433 and another for opening access to SQL Server when using dynamic ports. But unfortunately problems are not gone. My app can not access the data base. this is the string which I used in my app to retrieve data : Data Source=WIN-WKMIE6IIDYJ\SQLEXPRESSInitial Catalog=PazhooheshIntegrated Security=True My database does not have any username and password !! And my second problem is still there. when I turn my firewall off MDaemon can be accessible on port 3000 (my IP:3000) from another machine but when I turn it on, same problem. I added four rules for both peograms (sql server and MDaemon) !! Two in Inbound rules (port and program ) and two in Outbound rules but my problems are not gone. before any thing, thank a lot for your helps!! Quote
ICTCity Posted May 16, 2011 Posted May 16, 2011 I'm not really a good programmer... but I can remember that when I need to connect to a SQL server I prefer to use integrated auth. I used this whitepaper: http://www.asp.net/learn/whitepapers/aspnet-and-iis6 take a look at the end "Supporting integrated authentication with SQL Server" Regarding your firewall, you surely have done something wrong with rules. Let's start from Mdaemon. Yours rules may be correct, but you have to allow EXEs too. From the KB of Mdaemon, you should permit these EXEs: MDaemon.exe WorldClient.exe WebAdmin.exe MDSpamD.exe AVUpdate.exe The same thing must be made for SQL server's executable. Quote -------------------------------------------------------- Tu peux aussi crire en franais. Du kannst auch auf Deutsch schreiben. Puoi scrivere anche in italiano. --------------------------------------------------------
Baran Posted May 16, 2011 Author Posted May 16, 2011 Thank you for your answer. Regarding MDaemon problem, you were right. I should add above EXEs file to my firewall allowed program list. It's working well. but regarding SQL I do the same but nothing changed!! The problem still exist !! I don't know where is the problem!! I opened the ports 1433, I allowed almost all of sql EXEs files to be run throw my firewall I added rules just by the way that was said in Microsoft's official web site. My string Connections are right. My app. is working in Visual studio 2010 very good but in IIS it is not. I'm so confused!! Is there an other way ? Waiting for your answers... Quote
ICTCity Posted May 16, 2011 Posted May 16, 2011 My string Connections are right. I don't think so. When you disabled FW, you haven't resolved your problem. have you followed the guide found in the link above? What I mean is that MAYBE the problem is the "blank" authentication... Quote -------------------------------------------------------- Tu peux aussi crire en franais. Du kannst auch auf Deutsch schreiben. Puoi scrivere anche in italiano. --------------------------------------------------------
Baran Posted May 16, 2011 Author Posted May 16, 2011 What I mean is that MAYBE the problem is the "blank" authentication... !! well you mean the problem is with my connection strings? If it is, so why I have no problem in visual studio? Let's assume that, that is the problem, how should I change my strings into the correct form? Let me say something honestly, I didn't catch your meaning by: " The problem is the blank authentication." Quote
ICTCity Posted May 17, 2011 Posted May 17, 2011 !! well you mean the problem is with my connection strings? If it is, so why I have no problem in visual studio? Let's assume that, that is the problem, how should I change my strings into the correct form? Let me say something honestly, I didn't catch your meaning by: " The problem is the blank authentication." Well, I never tried to authenticate without username / password or at least windows auth. I just think you may have created a connection in visual studio (from the wizard) and you have the connection from there. Once you launch the program without visual studio, it doesn't know how to authenticate. Can you post the error message? Quote -------------------------------------------------------- Tu peux aussi crire en franais. Du kannst auch auf Deutsch schreiben. Puoi scrivere anche in italiano. --------------------------------------------------------
Baran Posted May 17, 2011 Author Posted May 17, 2011 Well I don't know you may be right The error I get is very simple: Object removed here!! which "here" is linked into the first page of my app. (Default.aspx) !! Quote
ICTCity Posted May 17, 2011 Posted May 17, 2011 Mhhh this make me think that your string is correct... Do you installed the last framework version? It should be 4. Also, the error you have should be OBJECT MOVED HERE and not object REmoved here. Is it correct? Quote -------------------------------------------------------- Tu peux aussi crire en franais. Du kannst auch auf Deutsch schreiben. Puoi scrivere anche in italiano. --------------------------------------------------------
Baran Posted May 19, 2011 Author Posted May 19, 2011 Well, this app is on framework 3.5 and this framework is installed on my server but I don't know is it necessary to install framework 4 or not but I'll install it. Regarding my error i should say, yes, you are right :D It is OBJECT MOVED HERE which "HERE" is linked to my first page "Default.aspx". I still have problem and I couldn't find any solution. Waiting for you answer... Quote
ICTCity Posted May 19, 2011 Posted May 19, 2011 Mhhh no, you don't have to install Framework 4, the problem was only with 1. So take a look at your code. First of all make a try, use Firefox or Chrome and notice if you have the same problem. Then, in your code, make sure you have these lines: (provided by a programmer to me): 'Before the redirect code, place this: Response.BufferOutput = true Still the programmer says: if you are redirecting a page, remember that once your HTML code has been sent to client, you CANNOT redirect a page, unless you want to use JavaScript. Let me know. Quote -------------------------------------------------------- Tu peux aussi crire en franais. Du kannst auch auf Deutsch schreiben. Puoi scrivere anche in italiano. --------------------------------------------------------
Baran Posted May 20, 2011 Author Posted May 20, 2011 I try " Response.BufferOutput = true " but result was the same!! :(( This is the Code I use in my page: string NationalCode ADO AD = new ADO() bool checkRow = true String url = "" string connection = "data source=LEGEND\\LEGEND initial catalog=Pazhoohesh integrated security=SSPI" SqlConnection Con = new SqlConnection(connection) SqlCommand Com = new SqlCommand("", Con) SqlDataReader DR Com.CommandText = "select [LogIn].LNationalCode,Person.ID,Person.ImgDirectory,[LogIn].LogintType,[LogIn].OK from [LogIn],Person where Person.NationalCode=[LogIn].LNationalCode " + "and [LogIn].UserName='" + this.TextBox1.Text.ToString() + "' and Password='" + this.TextBox2.Text.ToString() + "' and LogIn.LogintType='" + this.DropDownList1.SelectedItem.Text + "'" try { Con.Open() DR = Com.ExecuteReader() DR.Read() if (!DR.HasRows) { checkRow = false } else { string image_link = DR["ImgDirectory"].ToString() String ID_hold = DR["ID"].ToString() switch (DR["LogintType"].ToString()) { case "?????": if (DR["OK"].ToString() != "True") { url = "NotAllowed.aspx" break } url = "ControlPanel/Prof.aspx?" NationalCode = AD.encrypt_Nationalcode(DR["LNationalCode"].ToString()) url += "NC=" + NationalCode + "&Img=" + AD.encrypt_Img(image_link) + "&LE=" + AD.encrypt_Nationalcode(ID_hold) break case "???? ????": url = "SiteManager/SMHomePage.aspx?" NationalCode = AD.encrypt_Nationalcode(DR["LNationalCode"].ToString()) url += "NC=" + NationalCode + "&Img=" + AD.encrypt_Img(image_link) + "&LE=" + AD.encrypt_Nationalcode(ID_hold)+"&SW=0" break default: break } } } catch (Exception t) { } finally { Con.Close() } if (!checkRow) { Response.Redirect("NotFound.aspx") } else { Response.Redirect(url) } Is there any thing wrong with my codes?!! Quote
ICTCity Posted May 20, 2011 Posted May 20, 2011 From my poor knowledge of web programming, your code is ok... the only thing I can suggest you is to ask on a dedicated programmers forum, this is not a "server" problem. It is just a suggestion, I can't help you anymore with this, sorry. Quote -------------------------------------------------------- Tu peux aussi crire en franais. Du kannst auch auf Deutsch schreiben. Puoi scrivere anche in italiano. --------------------------------------------------------
Baran Posted May 21, 2011 Author Posted May 21, 2011 Well Thank you very much You helped me a lot. I learned so many things here I'll check my problem in programming forum ) Quote
Baran Posted June 8, 2011 Author Posted June 8, 2011 Hi every body. regarding problem I had (the SQL server one - I had two problems if you remember), I should say that I could fix it The solution was: 1) My log in SQL account (sa) was disable which should be enabled. To enable that I did the following: Under my server name in SQL server management studio->security -> logins-> sa-> double click on it -> click on Status from the right pan -> check the enable radio button 2) SQL login mode must be a mixed form of windows authentication and SQL server authentication. To change that I did the following: in SQL server management studio right click the server at the root of tree menu in left pan -> select properties -> security tab from left pan -> exchange server authentication from "Windows authentication mode" to "SQL server and windows authentication mode" 3) In the connection string I added the "sa" as Username and it's password as my login account to sql server you can do the same for another account which you want to be confirmed instead of "sa" !! here is my e-mail address for more help if you have the same problem and I could help you m.ahmadi@baranict.com Quote
ICTCity Posted June 8, 2011 Posted June 8, 2011 thanks for your solution. Quote -------------------------------------------------------- Tu peux aussi crire en franais. Du kannst auch auf Deutsch schreiben. Puoi scrivere anche in italiano. --------------------------------------------------------
Recommended Posts