PDA

توجه ! این یک نسخه آرشیو شده میباشد و در این حالت شما عکسی را مشاهده نمیکنید برای مشاهده کامل متن و عکسها بر روی لینک مقابل کلیک کنید : مشکل فوری فوری فوری در آپلود سایت



theunforgiven
May 4th, 2014, 23:00
درود و احترام دوستان

یه فایلی دارم که به هیچ راهی راست ! نمیشه :دی

وظیفه اش اتصال به پایگاه داده sql2008 ئه

هیچ رقم کانکت نمیشه

ارور سایت: http://epcforce.com/

نام فایل: connection.cs

کد:


using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;

namespace epcfprce1.Business
{
public static class Connection
{
private static SqlConnection Con { get { return new SqlConnection("Data Source=127.0.0.1\SQL2008;Initial Catalog=epcforce_ME3;User ID=ME3;Password=Me@4989Mm;MultipleActiveResultSets =True"); } }

public static bool RunNonQueryProcedure(string Title, params SqlParameter[] parameter)
{

SqlCommand Command = new SqlCommand(Title, Con);

Command.CommandType = CommandType.StoredProcedure;

Command.Parameters.AddRange(parameter);

try
{

Command.Connection.Open();

Command.ExecuteNonQuery();

return true;
}


catch (SqlException ex)
{

throw ex;
}

finally
{

if (Con.State == ConnectionState.Open)
{
Con.Close();

}

}
}

public static bool RunScalarProcedure(string Title, params SqlParameter[] parameter)
{

SqlCommand Command = new SqlCommand(Title, Con);

Command.CommandType = CommandType.StoredProcedure;

Command.Parameters.AddRange(parameter);

Command.Connection.Open();

int C = (int)Command.ExecuteScalar();

if (C == 1)
{
return true;
}

return false;

}

public static DataTable RunReaderproc(string title)
{
SqlCommand Command = new SqlCommand(title, Con);

Command.CommandType = CommandType.StoredProcedure;



SqlDataAdapter Adapter = new SqlDataAdapter(Command);

try
{
DataTable dt = new DataTable("Data");

Adapter.Fill(dt);

return dt;
}
catch (Exception ex)
{
throw ex;
}
finally
{
if (Command.Connection.State == ConnectionState.Open)
Command.Connection.Close();
}
}
}
}

فردا نمایشگاه شروع میشه باید سایت و تحویل بدم بیچاره میشم لطفا کمک کنید

- - - Updated - - -

اینم فایل وب کانفیگ من که درست هم کار می کنه:


<?xml version="1.0"?>

<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->

<configuration>
<connectionStrings>
<clear/>
<!--برای استفاده در سرور-->
<add name="DataConnectionString" connectionString="Data Source=127.0.0.1\SQL2008;Initial Catalog=epcforce_ME3;User ID=ME3;Password=Me@4989Mm;MultipleActiveResultSets =True" providerName="System.Data.SqlClient"/>
<!--برای استفاده در لوکال-->
<!--<add name="DataConnectionString" connectionString="Data Source=localhost;Initial Catalog=EpcForce;Integrated Security=True;MultipleActiveResultSets=True" providerName="System.Data.SqlClient"/>-->
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
<customErrors defaultRedirect="~/Index.aspx" mode="Off"/>
</system.web>

</configuration>

iranian-portal
May 5th, 2014, 00:24
من متوجه نشدم والا!!!
اما لینکی که دادین ارور دسترسی ممنوع میده
و این ارتباطی با بانک اطلاعاتی یا کانکت شدن به اون نداره
ارور دسترسی ممتوع ممکنه در دو حالت زیر رخ بده:
اول این که سطح دسترسی پوشه public_html رو تغییر داده باشید و اجازه مشاهده نده
دوم این که در فایل .htaccess عدم پذیرش بازدید داشته باشید که چنین دستوری هست:
Deny from all