Click here to Skip to main content
15,890,897 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Removing a Sub Page_Load()? Pin
Member 876166723-Jun-14 11:16
Member 876166723-Jun-14 11:16 
GeneralRe: Removing a Sub Page_Load()? Pin
jkirkerx23-Jun-14 11:40
professionaljkirkerx23-Jun-14 11:40 
GeneralRe: Removing a Sub Page_Load()? Pin
Member 876166723-Jun-14 12:01
Member 876166723-Jun-14 12:01 
GeneralRe: Removing a Sub Page_Load()? Pin
jkirkerx23-Jun-14 13:03
professionaljkirkerx23-Jun-14 13:03 
GeneralRe: Removing a Sub Page_Load()? Pin
Member 876166723-Jun-14 14:18
Member 876166723-Jun-14 14:18 
GeneralRe: Removing a Sub Page_Load()? Pin
jkirkerx23-Jun-14 16:02
professionaljkirkerx23-Jun-14 16:02 
GeneralRe: Removing a Sub Page_Load()? Pin
Member 876166723-Jun-14 16:23
Member 876166723-Jun-14 16:23 
QuestionThe connection String property has not been initialized? Error Pin
Inayat ali jan21-Jun-14 8:45
Inayat ali jan21-Jun-14 8:45 
Hello:
i am using this kind of code for connection to the data base.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Configuration;

namespace Kiu_webS
{
public class Connections
{
SqlConnection _connection;

private string connStr = "";

public Connections()
{
connStr = ConfigurationManager.ConnectionStrings["ConnStr"].ConnectionString;


}

public Connections(string conStr)
{
this.connStr = conStr;


}
public string connectionString
{
get { return connStr; }
set { connStr = value; }

}
public SqlConnection GetDBConnection()
{
_connection = new SqlConnection(connStr);
return _connection;
}
public void connectDB()
{
try
{
_connection.Open();

}
catch
{

throw;
}

}
public void DisconnectDB()
{
try
{
_connection.Close();

}
catch
{

throw;
}
}
}
}

as i insert data from form to database i am getting this error. The coonection String property has not been initialized.

web.config file

XML
<configuration>
  <connectionStrings>

    <add name="ConnStr" connectionString="Data Source = inayat; Initial Catalog = KIU; User ID=sa; Password=jan5562"/>
  </connectionStrings>
    <system.web>
        <compilation debug="true" targetFramework="4.0"/>
    <authentication mode="Forms">
      <forms name="KIUAuth" loginUrl="login.aspx" protection="All" path="KIUAuth/" timeout="30" slidingExpiration="true"/>
    </authentication>
    </system.web>
</configuration>

AnswerRe: The connection String property has not been initialized? Error Pin
Member 1089879721-Jun-14 19:47
Member 1089879721-Jun-14 19:47 
QuestionMVC Razor: Getting a user id stored in Entity Framework when calling the Controller that Display Profile View. Pin
Stephen Holdorf21-Jun-14 7:57
Stephen Holdorf21-Jun-14 7:57 
QuestionMVC Razor: Dynamically displaying and hiding UI text controls in the parent View and it's partial Views. Pin
Stephen Holdorf21-Jun-14 7:43
Stephen Holdorf21-Jun-14 7:43 
Questionmsbuild with no Visual Studio (Yes Windows SDK installed & Copy Local=true) Pin
devvvy20-Jun-14 11:26
devvvy20-Jun-14 11:26 
QuestionStore gridview selected row values in sessions Pin
hilbiazhar20-Jun-14 1:49
hilbiazhar20-Jun-14 1:49 
AnswerRe: Store gridview selected row values in sessions Pin
Deflinek20-Jun-14 9:02
Deflinek20-Jun-14 9:02 
QuestionHow to send a mail from local SMTP server. Pin
Kandepu Rajesh18-Jun-14 11:18
Kandepu Rajesh18-Jun-14 11:18 
SuggestionRe: How to send a mail from local SMTP server. Pin
Richard MacCutchan18-Jun-14 22:35
mveRichard MacCutchan18-Jun-14 22:35 
GeneralRe: How to send a mail from local SMTP server. Pin
Kandepu Rajesh19-Jun-14 13:31
Kandepu Rajesh19-Jun-14 13:31 
GeneralRe: How to send a mail from local SMTP server. Pin
Richard MacCutchan19-Jun-14 22:37
mveRichard MacCutchan19-Jun-14 22:37 
GeneralRe: How to send a mail from local SMTP server. Pin
Kandepu Rajesh20-Jun-14 10:11
Kandepu Rajesh20-Jun-14 10:11 
GeneralRe: How to send a mail from local SMTP server. Pin
Richard MacCutchan20-Jun-14 12:57
mveRichard MacCutchan20-Jun-14 12:57 
GeneralRe: How to send a mail from local SMTP server. Pin
Kandepu Rajesh23-Jun-14 11:40
Kandepu Rajesh23-Jun-14 11:40 
GeneralRe: How to send a mail from local SMTP server. Pin
Richard MacCutchan25-Jun-14 15:16
mveRichard MacCutchan25-Jun-14 15:16 
GeneralRe: How to send a mail from local SMTP server. Pin
Kandepu Rajesh26-Jun-14 16:12
Kandepu Rajesh26-Jun-14 16:12 
GeneralRe: How to send a mail from local SMTP server. Pin
Richard MacCutchan27-Jun-14 5:56
mveRichard MacCutchan27-Jun-14 5:56 
GeneralRe: How to send a mail from local SMTP server. Pin
Kandepu Rajesh27-Jun-14 10:59
Kandepu Rajesh27-Jun-14 10:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.