Error When Submitting A Form: The ConnectionString Property Has Not Been Intialized.

Apr 10, 2007

Hello!  I'm recieving an error when I submit a form to an Access database.  I took this site over from someone else and kept their code as I'm more of a designer than a programmer.  If anyone has any ideas as to how to fix it, I would really appreciate it.  I'm pretty clueless when it comes to this.  I've tried to figure it out on my own, but I seem to be failing.  Any help would be great!  Here's what I receive when I submit the form:

 
The ConnectionString property has not been initialized.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: The ConnectionString property has not been initialized.

Source Error:





An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:





[InvalidOperationException: The ConnectionString property has not been initialized.]
System.Data.OleDb.OleDbConnection.Open() +203
modern_foods.promotions_form.saveInfo(Object s, EventArgs e) +535
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1292

Thank you in advance!

View 10 Replies


ADVERTISEMENT

ERROR: The ConnectionString Property Has Not Been Initialized.

Apr 17, 2008

Hello,
am trying to run a SP in my class against my database.
However, I get the error below.
The connection string is in the web.config file as thus
<connectionStrings>  <add name="cell_ConnectionString" connectionString="Data Source=xxx.xxx.xxx.xxx,2433;Network Library=DBMSSOCN;Initial Catalog=day;User ID=day;Password=jdhje5rhydgd;" providerName="System.Data.SqlClient"/> </connectionStrings>
and the connection string name is called in my class as thus
 1 SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["cell_ConnectionString"]);
2
3 SqlCommand command = new SqlCommand("cell_ConnectionString", con);
4 command.CommandType = CommandType.StoredProcedure;
5
  
What is wrong here ?
thanks
Ehi
 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidOperationException: The ConnectionString property has not been initialized.Source Error:




Line 49: command.CommandType = CommandType.StoredProcedure;
Line 50:
Line 51: con.Open();
Line 52:
Line 53: command.Parameters.Add(new SqlParameter("@csv", SqlDbType.VarChar, 8000, "recipients"));
Source File: c:inetpubwwwrootizevwwwrootwelcomesms.aspx.cs    Line: 51

View 2 Replies View Related

ExcuteNonQuery: Connection Property Has Not Been Intialized

Jun 11, 2008

What is missing?  I'm lost?
private void InsertRecord(string host, int RequestID)    {        //int reset = 0;
        SqlConnection cn = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);        cn.Open();
                str = "INSERT INTO HostName (Host,HostNameRequestID) VALUES ('" + host + "'," + RequestID + ")";        SqlCommand cmd = new SqlCommand("", cn);        cmd.CommandText = "INSERT INTO HostName (Host,HostNameRequestID) VALUES ('" + host + "'," + RequestID + ")";        cmd.ExecuteNonQuery();        cn.Close();    }

View 2 Replies View Related

Data Access Error - ConnectionString Property

Mar 29, 2006

Hi guys,
I'm getting this error:System.InvalidOperationException: The ConnectionString property has not been initialized
when I'm trying to connect to an SQL database using the following code:
Dim mySelectQuery As String = "SELECT [tabl_id] FROM [myTable]"Dim myConnection As New SqlConnection(System.Configuration.ConfigurationManager.AppSettings("myConnString"))Dim myCommand As New SqlCommand(mySelectQuery, myConnection)myConnection.Open()Dim myReader As SqlDataReadermyReader = myCommand.ExecuteReader()While myReader.Read()   Response.Write(myReader("tabl_id") & "<br/>")End WhilemyConnection.Close()
and in web.config:
<appSettings/>   <connectionStrings>      <add name="myConnString" connectionString="Data Source=100.100.100.100;Initial Catalog=myDatabase;User ID=me;Password=password" providerName="System.Data.SqlClient"/>   </connectionStrings>
If I place the actual connection string inside instead of trying to reference the web.config setting it works, but using 'System.Configuration.ConfigurationManager.AppSettings' returns the error. Is there something I'm doing wrong?

View 2 Replies View Related

Submitting Test From Form Into SQL Database

Feb 21, 2008

Hi,
I'm not very asp.net savy and could not find any solid examples of what I need done. I have one text box on my page and one submit button. I would like the information entered from the text box to go into a SQL database when clicking on the submit button. I'm not sure what the exact coding should be in order to get this operating the way I want. I'm coding in VB, this is what I have so far:<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server"><title>Untitled Page</title>
<script language="javascript" type="text/javascript">
// <!CDATA[function Submit1_onclick() {
}
// ]]></script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input id="Text1" type="text" /><br />
<input id="Submit1" type="submit" value="submit" onclick="return Submit1_onclick()" /></div></form>
</body>
</html>
Thanks,
Derek
 

View 1 Replies View Related

When Submitting Form, SQL Server Fields Only Show The First Letter

Nov 30, 2005

Hi, I'm new around here and am stumped.  I have created a form where I submit the information into a SQL Server 2000 table.  When I submit the information through the form, only the first character of each field populates inside of the SQL table.  This happens for every field except for two, zip and comments.  The zip field is numeric and the comments field is text.  All the other fields are varchar fields; and these are the fields with the problems.  I have attempted to change the data type to text, but that did not work either.  I am doing this through a stored procedure I created.  Here is the asp code:
Public Class WebForm1
Inherits System.Web.UI.Page
Protected WithEvents txtFirstName As System.Web.UI.WebControls.TextBox
Protected WithEvents txtLastName As System.Web.UI.WebControls.TextBox
Protected WithEvents txtAddress1 As System.Web.UI.WebControls.TextBox
Protected WithEvents txtAddress2 As System.Web.UI.WebControls.TextBox
Protected WithEvents txtCity As System.Web.UI.WebControls.TextBox
Protected WithEvents txtZip As System.Web.UI.WebControls.TextBox
Protected WithEvents txtEmail As System.Web.UI.WebControls.TextBox
Protected WithEvents txtPhone As System.Web.UI.WebControls.TextBox
Protected WithEvents txtComments As System.Web.UI.WebControls.TextBox
Protected WithEvents ddlState As System.Web.UI.WebControls.DropDownList
Protected WithEvents ddlGift1 As System.Web.UI.WebControls.DropDownList
Protected WithEvents ddlGift2 As System.Web.UI.WebControls.DropDownList
Protected WithEvents ddlGift3 As System.Web.UI.WebControls.DropDownList
Protected WithEvents Form1 As System.Web.UI.HtmlControls.HtmlForm
Protected WithEvents SqlConnection1 As System.Data.SqlClient.SqlConnection
Protected WithEvents SqlCommand1 As System.Data.SqlClient.SqlCommand
Protected WithEvents btnSubmit As System.Web.UI.WebControls.Button
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.SqlConnection1 = New System.Data.SqlClient.SqlConnection()
Me.SqlCommand1 = New System.Data.SqlClient.SqlCommand()
'
'SqlConnection1
'
Me.SqlConnection1.ConnectionString = "data source=NDAVENPORT2;initial catalog=Bluestreak;integrated security=SSPI;persi" & _
"st security info=False;workstation id=NDAVENPORT2;packet size=4096"
'
'SqlCommand1
'
Me.SqlCommand1.CommandText = "dbo.[InsertFreeOrders]"
Me.SqlCommand1.CommandType = System.Data.CommandType.StoredProcedure
Me.SqlCommand1.Connection = Me.SqlConnection1
Me.SqlCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, False, CType(10, Byte), CType(0, Byte), "", System.Data.DataRowVersion.Current, Nothing))
Me.SqlCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@firstname", System.Data.SqlDbType.VarChar, 50))
Me.SqlCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@lastname", System.Data.SqlDbType.VarChar, 50))
Me.SqlCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@address1", System.Data.SqlDbType.VarChar, 100))
Me.SqlCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@address2", System.Data.SqlDbType.VarChar, 100))
Me.SqlCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@city", System.Data.SqlDbType.VarChar, 50))
Me.SqlCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@state", System.Data.SqlDbType.VarChar, 50))
Me.SqlCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@zip", System.Data.SqlDbType.Decimal, 9, System.Data.ParameterDirection.Input, False, CType(18, Byte), CType(0, Byte), "", System.Data.DataRowVersion.Current, Nothing))
Me.SqlCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@email", System.Data.SqlDbType.VarChar, 50))
Me.SqlCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@phone", System.Data.SqlDbType.VarChar, 50))
Me.SqlCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@item1", System.Data.SqlDbType.VarChar, 50))
Me.SqlCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@item2", System.Data.SqlDbType.VarChar, 50))
Me.SqlCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@item3", System.Data.SqlDbType.VarChar, 50))
Me.SqlCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@comments", System.Data.SqlDbType.VarChar, 2147483647))
End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub
Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
If IsValid Then
SqlCommand1.Parameters("@firstname").Value = txtFirstName.Text
SqlCommand1.Parameters("@lastname").Value = txtLastName.Text
SqlCommand1.Parameters("@address1").Value = txtAddress1.Text
SqlCommand1.Parameters("@address2").Value = txtAddress2.Text
SqlCommand1.Parameters("@city").Value = txtCity.Text
SqlCommand1.Parameters("@state").Value = ddlState.SelectedItem.Text
SqlCommand1.Parameters("@zip").Value = txtZip.Text
SqlCommand1.Parameters("@email").Value = txtEmail.Text
SqlCommand1.Parameters("@phone").Value = txtPhone.Text
SqlCommand1.Parameters("@item1").Value = ddlGift1.SelectedItem.Text
SqlCommand1.Parameters("@item2").Value = ddlGift2.SelectedItem.Text
SqlCommand1.Parameters("@item3").Value = ddlGift3.SelectedItem.Text
SqlCommand1.Parameters("@comments").Value = txtComments.Text
SqlConnection1.Open()
SqlCommand1.ExecuteNonQuery()
SqlConnection1.Close()
Response.Redirect("Success.aspx")
End If
End Sub
End ClassMy stored procedure looks like this:CREATE PROCEDURE dbo.InsertFreeOrders  (  @firstname varchar( 50 ),  @lastname varchar( 50 ),  @address1 varchar( 100 ),  @address2 varchar( 100 ),  @city varchar( 50 ),  @state varchar( 50 ),  @zip numeric,  @email varchar( 50 ),  @phone varchar( 50 ),  @item1 varchar( 50 ),  @item2 varchar( 50 ),  @item3 varchar( 50 ),  @comments text  )ASInsert FreeOrders ( o_first_name, o_last_name, o_address_1, o_address_2, o_city, o_state, o_zip, o_email, o_phone, o_item_1, o_item_2, o_item_3, o_comments ) Values ( @firstname, @lastname, @address1, @address2, @city, @state, @zip, @email, @phone, @item1, @item2, @item3, @comments )GOSo it is working, just not completely and I am stumped here.  Any help would be great!  Thanks.

View 6 Replies View Related

Need Help Submitting Form Data To SQL 2005 Database Using SqlDataSource Control

Apr 18, 2006

I have a form setup, the code of which is listed below, and I would like to be able to submit the data that is entered in the form to a SQL 2005 standard database via the SqlDataSource control and a button. I'm just having trouble doing so because of the coding. Any help or suggestions would be greata s I've already read through the tutorials on this site and they don't go in depth very much. Thanks!
<%@ Page Language="VB" %>
<%@ Register Assembly="BasicFrame.WebControls.BasicDatePicker" Namespace="BasicFrame.WebControls"
TagPrefix="BDP" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.SqlClient" %>
<Script runat="server">
Private Sub InsertData(ByVal Source As Object, ByVal e As EventArgs)
SqlDataSource1.Insert()
End Sub
</Script>
 
 
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Weston E-Vault - New Customer Sign-Up Form</title>
</head>
<body>
<form id="form1" runat="server">
<div style="text-align: center">
&nbsp;<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="Data Source=C26819_24561;Initial Catalog=ebackups;Integrated Security=True;User Instance=False" ProviderName="System.Data.SqlClient" InsertCommand="INSERT INTO backup_info(cust_name, cust_phone, cust_contact, cust_analyst, storage_plan, install_date, backup_data, backupexec_option, backup_program, cust_email) VALUES (@cust_name, @cust_phone, @cust_contact, @cust_analyst, @storage_plan, @install_date, @backup_data, @backupexec_option, @backup_program, @cust_email)">
<InsertParameters>
<asp:ControlParameter ControlID="DropDownList1" DefaultValue="" Name="@cust_name"
PropertyName="SelectedValue" />
<asp:ControlParameter ControlID="TextBox1" Name="@cust_contact" PropertyName="Text" />
<asp:ControlParameter ControlID="TextBox2" Name="@cust_phone" PropertyName="Text" />
<asp:ControlParameter ControlID="DropDownList3" Name="@cust_analyst" PropertyName="SelectedValue" />
<asp:ControlParameter ControlID="BDPLite1" Name="@install_date" PropertyName="Controls" />
<asp:ControlParameter ControlID="TextBox3" Name="@cust_username" PropertyName="Text" />
<asp:ControlParameter ControlID="TextBox4" Name="@cust_password" PropertyName="Text" />
<asp:ControlParameter ControlID="DropDownList2" Name="@storage_plan" PropertyName="SelectedValue" />
<asp:ControlParameter ControlID="TextBox5" Name="@backup_data" PropertyName="Text" />
<asp:ControlParameter ControlID="RadioButtonList1" Name="@backupexec_option" PropertyName="SelectedValue" />
<asp:ControlParameter ControlID="TextBox6" Name="@backup_program" PropertyName="Text" />
<asp:ControlParameter ControlID="TextBox7" Name="@cust_email" PropertyName="Text" />
</InsertParameters>
</asp:SqlDataSource>
&nbsp;
<br />
<br />
<br />
<table>
<tr>
<td style="width: 100px">
<img src="/images/westonevault_logo.jpg" /></td>
<td style="width: 703px; text-align: right">
<asp:Button ID="Button1" runat="server" BackColor="White" BorderColor="Navy" BorderStyle="Solid"
BorderWidth="1px" Font-Names="verdana" Font-Size="Small" ForeColor="Navy" PostBackUrl="~/secure/tech_home.aspx"
Text="Back" /><span style="font-size: 8pt; color: #000099">&nbsp;</span></td>
</tr>
</table>
<br />
<br />
<img src="/images/div.jpg" style="font-size: 8pt; color: #000099" /><br />
<br />
<div style="text-align: center">
<table style="font-size: 8pt; width: 730px; color: #000099; font-family: Verdana">
<tr>
<td colspan="3" style="font-weight: bold; font-family: Verdana; text-align: left">
<span style="color: #000099">Customer Information<br />
</span>
<hr style="color: #000099" />
<span style="font-weight: normal; font-size: 8pt; color: #000099">Please enter all customer
data as accurately as possible. Any incorrect information on this form may result
in incorrect data being backed up, reports not reaching the customer or they may<span
style="font-size: 12pt"><strong> </strong><span style="font-size: 8pt">not receive the need</span></span>ed amount of disk
space.<br />
&nbsp;<br />
</span>
</td>
</tr>
<tr style="font-size: 8pt">
<td style="width: 174px; text-align: left">
<span style="font-family: Verdana"><span style="color: navy">Customer
Name:<br />
</span>
<asp:DropDownList ID="DropDownList1" runat="server" DataValueField="cust_name" Font-Names="Verdana"
Font-Size="X-Small" ForeColor="Navy" Width="178px">
<asp:ListItem Selected="True">Select Customer Name.....</asp:ListItem>
<asp:ListItem>Alaska Road Boring</asp:ListItem>
<asp:ListItem>Allen and Peterson</asp:ListItem>
<asp:ListItem>AK Guns</asp:ListItem>
<asp:ListItem>ATS Alaska</asp:ListItem>
<asp:ListItem>BC Contractors</asp:ListItem>
<asp:ListItem>Bek of Alaska</asp:ListItem>
<asp:ListItem>Brokentop Community Assoc.</asp:ListItem>
<asp:ListItem>COHRA</asp:ListItem>
<asp:ListItem>Crisis Pregnancy Center</asp:ListItem>
<asp:ListItem>Gaines and Co.</asp:ListItem>
<asp:ListItem Value="Gil Damond">Gil Damond</asp:ListItem>
<asp:ListItem>GMW Fire</asp:ListItem>
<asp:ListItem>Integrity Funding</asp:ListItem>
<asp:ListItem>La Pine Community Clinic</asp:ListItem>
<asp:ListItem>La Pine Fire District</asp:ListItem>
<asp:ListItem>Lumbermens Ins.</asp:ListItem>
<asp:ListItem>Murray</asp:ListItem>
<asp:ListItem>NEI</asp:ListItem>
<asp:ListItem>Northstar Center</asp:ListItem>
<asp:ListItem>Redi Electric</asp:ListItem>
<asp:ListItem>Robberson Ford</asp:ListItem>
<asp:ListItem>South Anchorage District Office</asp:ListItem>
<asp:ListItem>St. George Tanaq</asp:ListItem>
<asp:ListItem>Stinebaugh</asp:ListItem>
<asp:ListItem>THT Electric</asp:ListItem>
<asp:ListItem>Watterson</asp:ListItem>
<asp:ListItem>United Auto</asp:ListItem>
<asp:ListItem>Weston - ANC</asp:ListItem>
<asp:ListItem>Weston - BND</asp:ListItem>
<asp:ListItem></asp:ListItem>
</asp:DropDownList><br />
</span>
</td>
<td style="width: 187px; text-align: left">
<span style="font-family: Verdana"><span style="color: #000099">Customer
Contact:<br />
</span>
<asp:TextBox ID="TextBox1" runat="server" Font-Names="Verdana" Font-Size="X-Small"
Width="164px"></asp:TextBox><br />
</span>
</td>
<td style="width: 136px; text-align: left">
<span style="font-family: Verdana"><span style="color: #000099">Customer
Phone:<br />
</span>
<asp:TextBox ID="TextBox2" runat="server" Font-Names="verdana" Font-Size="X-Small"></asp:TextBox><br />
</span>
</td>
</tr>
<tr style="font-size: 8pt">
<td style="width: 174px; text-align: left">
<span style="font-family: Verdana"><span style="color: #000099">Customer
E-Vault Username:<br />
</span>
<asp:TextBox ID="TextBox3" runat="server" Font-Names="Verdana" Font-Size="X-Small"
Width="150px"></asp:TextBox><br />
</span>
</td>
<td style="width: 187px; text-align: left">
<span style="font-family: Verdana"><span style="color: #000099">Customer
E-Vault Password:<br />
</span>
<asp:TextBox ID="TextBox4" runat="server" Font-Names="Verdana" Font-Size="X-Small"
TextMode="Password" Width="150px"></asp:TextBox><br />
</span>
</td>
<td style="width: 136px; text-align: left">
<span style="font-family: Verdana"><span style="color: #000099">E-Vault
Storage Plan:<br />
</span>
<asp:DropDownList ID="DropDownList2" runat="server" DataValueField="storage_plan"
Font-Names="Verdana" Font-Size="X-Small" ForeColor="Navy">
<asp:ListItem Selected="True">Select Plan.....</asp:ListItem>
<asp:ListItem>0-300MB</asp:ListItem>
<asp:ListItem>300MB-2GB</asp:ListItem>
<asp:ListItem>2GB-4GB</asp:ListItem>
<asp:ListItem>4GB-6GB</asp:ListItem>
<asp:ListItem>6GB-8GB</asp:ListItem>
<asp:ListItem>8GB-15GB</asp:ListItem>
<asp:ListItem>15GB-25GB</asp:ListItem>
<asp:ListItem>25GB-35GB</asp:ListItem>
<asp:ListItem>35GB-50GB</asp:ListItem>
<asp:ListItem>50GB-100GB</asp:ListItem>
<asp:ListItem>100GB-200GB</asp:ListItem>
</asp:DropDownList><br />
</span>
</td>
</tr>
<tr style="font-size: 8pt">
<td style="width: 174px; text-align: left">
<span style="font-family: Verdana"><span style="color: #000099">Analyst:<br />
</span>
<asp:DropDownList ID="DropDownList3" runat="server" DataValueField="cust_analyst"
Font-Names="Verdana" Font-Size="X-Small" ForeColor="Navy" Width="162px">
<asp:ListItem>Select Analyst.....</asp:ListItem>
<asp:ListItem>Brock McFarlane</asp:ListItem>
<asp:ListItem>Cameron Farrally</asp:ListItem>
<asp:ListItem>Chad Huls</asp:ListItem>
<asp:ListItem>Eric Spinney</asp:ListItem>
<asp:ListItem>Greg Freeman</asp:ListItem>
<asp:ListItem>Harald Smit</asp:ListItem>
<asp:ListItem>Kevin Mark</asp:ListItem>
<asp:ListItem>Mark Anderson</asp:ListItem>
<asp:ListItem>Mike Murphy</asp:ListItem>
<asp:ListItem>Tim Elder</asp:ListItem>
</asp:DropDownList><br />
</span>
</td>
<td style="width: 187px; text-align: left">
<span style="font-family: Verdana"><span style="color: #000099">Today's
Date: (mm/dd/yyy)<br />
</span>
<bdp:bdplite id="BDPLite1" runat="server" borderstyle="None" cssclass="bdpLite" dateformat="ShortDate"
font-bold="False" font-names="verdana" font-size="X-Small" forecolor="Navy" selecteddate=""></bdp:bdplite>
</span>
</td>
<td style="width: 136px; text-align: left">
<br />
</td>
</tr>
<tr style="font-size: 8pt">
<td colspan="3">
</td>
</tr>
<tr style="font-size: 8pt">
<td colspan="3" style="text-align: left">
<span style="font-family: Verdana"><span style="color: #000099"><strong>
<br />
Backup Data<br />
<hr style="color: #000099" />
</strong><span>Please enter all directories and/or files and
folders the customer wishes to have backed up. Be thourough yet brief as this is
for historical and record keeping purposes.<br />
<br />
</span></span></span>
</td>
</tr>
<tr style="font-size: 8pt">
<td colspan="3" style="text-align: left">
<asp:TextBox ID="TextBox5" runat="server" ForeColor="#000000" Height="130px" MaxLength="200"
TextMode="MultiLine" Width="503px"></asp:TextBox><br />
</td>
</tr>
<tr style="font-size: 8pt">
<td style="width: 174px">
</td>
<td style="width: 187px">
</td>
<td style="width: 136px">
</td>
</tr>
<tr style="font-size: 8pt">
<td colspan="3" style="text-align: left">
<span style="font-family: Verdana"><span style="color: #000099"><strong>
<br />
BackupExec / NTBackup<br />
<hr style="color: #000099" />
</strong><span>Does the customer have another backup program
running that backs up their files to tape or another physical media.<br />
<br />
</span></span></span>
</td>
</tr>
<tr style="font-size: 8pt">
<td colspan="2" style="height: 41px; text-align: left">
<asp:RadioButtonList ID="RadioButtonList1" runat="server" Font-Names="Verdana" Font-Size="X-Small"
ForeColor="Navy" RepeatDirection="Horizontal" Width="127px">
<asp:ListItem Value="Yes">Yes</asp:ListItem>
<asp:ListItem Value="No">No</asp:ListItem>
</asp:RadioButtonList><span style="font-family: Verdana"><span style="color: #000099">If
"Yes", what program do they use?</span>
<asp:TextBox ID="TextBox6" runat="server" Font-Names="Verdana" Font-Size="X-Small"
Width="200px"></asp:TextBox><br />
</span>
</td>
<td style="width: 136px; height: 41px">
</td>
</tr>
<tr style="font-size: 8pt">
<td style="width: 174px">
</td>
<td style="width: 187px">
</td>
<td style="width: 136px">
</td>
</tr>
<tr style="font-size: 8pt">
<td colspan="3" style="text-align: left">
<span style="color: #000099"><span style="font-family: Verdana"><strong>
<br />
E-Mail Notifications<br />
<hr style="color: #000099" />
</strong><span>Does the customer wish to receive weekly reports
about their backups? (This includes what directories are being backed up, how much
storage space they have used on their plan and how much storage space is remaining).If
so enter their e-mail address below. If they don't want to receive notifications,
you can skip this section.<br />
<br />
</span></span></span>
</td>
</tr>
<tr style="font-size: 8pt">
<td style="width: 174px; text-align: left">
<asp:TextBox ID="TextBox7" runat="server" Font-Names="Verdana" Font-Size="XX-Small"
ForeColor="Navy" Width="201px"> N/A</asp:TextBox></td>
<td style="width: 187px">
</td>
<td style="width: 136px">
</td>
</tr>
<tr style="font-size: 8pt">
<td style="width: 174px">
</td>
<td style="width: 187px">
</td>
<td style="width: 136px">
</td>
</tr>
<tr style="font-size: 8pt">
<td style="width: 174px; height: 26px">
</td>
<td style="width: 187px; height: 26px; text-align: left">
<asp:Button ID="Button2" runat="server" BackColor="White" BorderColor="Navy" BorderStyle="Solid"
BorderWidth="1px" Font-Names="verdana" Font-Size="Small" OnClick="InsertData" Text="Submit Form" /></td>
<td style="width: 136px; height: 26px">
</td>
</tr>
</table>
&nbsp;&nbsp;</div>
<div style="text-align: center">
<img src="/images/div.jpg" /><br />
<br />
<span style="font-size: 7pt; font-family: Verdana">Copyright 2006 Weston Technology
Solutions </span>
</div>

</div>
</form>
</body>
</html>

View 3 Replies View Related

ConnectionString Property

Jun 28, 2006

I am having trouble initializing my connection. This is the code:


Dim
DBConnPhone As New
SqlConnection(ConfigurationManager.AppSettings("DBConnPhone"))




        Dim DBConnClient As New
SqlConnection(ConfigurationManager.AppSettings("DBConnClient"))       


        Dim Sqlcomm1 As New SqlCommand


        Dim Sqlcomm2 As New SqlCommand


        DBConnPhone.Open()


       
DBConnClient.Open()

Once I start debugging, it stops and give me the error "The ConnectionString Property was not initialized" Any suggestions?

View 4 Replies View Related

ConnectionString Property Not Set

Feb 14, 2007

 
Hi, After many nights without sleep I'm not seeing this? Can anyone help why I'm getting a ConnectionString Property not set error? thanks!
Dim Sconn As StringDim DBCon As New Data.SqlClient.SqlConnectionSconn = ConfigurationManager.AppSettings("LocalSqlServer")DBCon = New SqlClient.SqlConnection(Sconn)Dim cmdCommand As New Data.SqlClient.SqlCommand
'Dont forget to instantiate a connection object
cmdCommand.Connection = DBConDBCon.Open()

View 18 Replies View Related

The ConnectionString Property Has Not Been Initialized

Jul 30, 2007

In short, I have a couple grid views on a page that are used for editing as well as sorting, etc.  The grids are setup to use the SqlDataSources.  I'm trying to deploy this to a server environment for different instances (test,cert,prod) and am trying to set the ConnectionString for the SqlDataSource in the code behind (Page_Load()).  Everything works well, except, I get an error message that says the "ConnectionString Property Has Not Been Initialized."  Its a javascript alert coming up on top of the grid view.
Here is how I'm trying to set the ConnString in the Page_Load():this.EmployeeTimeCardDataSource.ConnectionString = ConfigurationManager.ConnectionStrings[connStr].ConnectionString;
Here is an example of the DataSource.<asp:SqlDataSource ID="EmployeeTimeCardDataSource" runat="server"    SelectCommand="sp_Select_Managers_Employees_List"    SelectCommandType="StoredProcedure">  <SelectParameters>     <asp:SessionParameter Name="CurrentUser" SessionField="User" Type="String" />  </SelectParameters></asp:SqlDataSource>
 

View 5 Replies View Related

ConnectionString Property Not Initialized

Oct 22, 2007

I am getting an error message that says that my connection string has not been intialized I have initialized it. 
Dim AirliquidiConn As New SqlClient.SqlConnection(ConfigurationManager.AppSettings("AirliquidiDatabase"))
Any suggestions??

View 10 Replies View Related

The ConnectionString Property Has Not Been Initialized

Jan 25, 2008

Hi all
      This is the code in my web.config file.
       <appSettings>    <add key="ConnectionString" value="server=127.0.0.1;database=testdb;uid=sa;pwd=sa"/>     </appSettings>
      When I'm connecting to the sqlserver database,the page shows that The ConnectionString property has not been initialized.
      The code that I used to get the "ConnectionString" as belows
using System.Configuration;
protected static string connectionString =ConfigurationSettings.AppSettings["ConnectionString"]; 
  public static object GetSingle(string SQLString,params SqlParameter[] cmdParms)  {   using (SqlConnection connection = new SqlConnection(connectionString))   {    using (SqlCommand cmd = new SqlCommand())    {     try     {                              PrepareCommand(cmd, connection, null,SQLString, cmdParms);      object obj = cmd.ExecuteScalar();      cmd.Parameters.Clear();      if((Object.Equals(obj,null))||(Object.Equals(obj,System.DBNull.Value)))      {            return null;      }      else      {       return obj;      }         }     catch(System.Data.SqlClient.SqlException e)     {          throw new Exception(e.Message);     }         }   }  }
 
These code works well on my machine.When running on my colleague's machine ,the page show that exception.
  Any ideal?

View 3 Replies View Related

The ConnectionString Property Has Not Been Initialized.

Mar 21, 2008

I tried to insert my inputs into the database but it says "The ConnectionString property has not been initialized."
 
These are my codes:
SubmitAssigment.aspx.vb
 Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Dim conn As SqlConnection Dim mycmd As SqlCommand Dim dr As SqlDataReader Dim str As String conn = New SqlConnection(Configuration.ConfigurationManager.AppSettings("ConnectionString")) conn.Open() str = "INSERT INTO [UploadInfo] ([StudentID], [Subject], [Assigment], [File], [Upload], [Time]) VALUES (@StudentID, @Subject, @Assigment, @File, @Upload , @Time )" mycmd = New SqlCommand(str, conn) mycmd.Parameters.Add("@StudentID", Data.SqlDbType.VarChar, 500).Value = User.Identity.Name mycmd.Parameters.Add("@Subject", Data.SqlDbType.VarChar, 500).Value = DropDownList1.SelectedValue mycmd.Parameters.Add("@Assigment", Data.SqlDbType.VarChar, 500).Value = DropDownList2.SelectedValue mycmd.Parameters.Add("@File", Data.SqlDbType.VarChar, 500).Value = File1.PostedFile.FileName mycmd.Parameters.Add("@Upload", Data.SqlDbType.VarChar, 500).Value = "Yes" mycmd.Parameters.Add("@Time", Data.SqlDbType.VarChar, 500).Value = System.DateTime.Now dr = mycmd.ExecuteReader() mycmd.Dispose() dr.Close() End Sub
  
SubmitAssigment.aspx
 
 <%@ Page Language="VB" AutoEventWireup="false" CodeFile="SubmitAssigment.aspx.vb" Inherits="Student_SubmitAssigment" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title>Untitled Page</title> <style type="text/css"> .style1 { width: 100%; } .style2 { width: 70px; } .style3 { width: 106px; } </style></head><body> <form id="Form1" method="post" enctype="multipart/form-data" runat="server"> <p> &nbsp;</p> <table class="style1"> <tr> <td class="style2"> Subject:</td> <td> <asp:DropDownList ID="DropDownList1" runat="server" Height="16px" Width="253px"> <asp:ListItem Selected="True">Select one....</asp:ListItem> <asp:ListItem>TCP2411 - Programming Language Concept</asp:ListItem> </asp:DropDownList> </td> </tr> <tr> <td class="style2"> Assigment</td> <td> <asp:DropDownList ID="DropDownList2" runat="server" Height="16px" Width="105px"> <asp:ListItem Selected="True">Select one....</asp:ListItem> <asp:ListItem>1</asp:ListItem> <asp:ListItem>2</asp:ListItem> <asp:ListItem>3</asp:ListItem> <asp:ListItem></asp:ListItem> </asp:DropDownList> </td> </tr> </table><p> &nbsp;</p> <input type= "file" id= "File1" name= "File1" runat="server" /> <br /><br />&nbsp;<asp:Button ID="Submit1" runat="server" Text="Upload" /> <br /> <br /> <br /> <asp:LoginName ID="LoginName" runat="server" /> <br /> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConflictDetection="CompareAllValues" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" DeleteCommand="DELETE FROM [UploadInfo] WHERE [StudentID] = @original_StudentID AND [Subject] = @original_Subject AND [Assigment] = @original_Assigment AND [File] = @original_File AND [Upload] = @original_Upload AND [Time] = @original_Time" InsertCommand="INSERT INTO [UploadInfo] ([StudentID], [Subject], [Assigment], [File], [Upload], [Time]) VALUES (@StudentID, @Subject, @Assigment, @File, @Upload , @Time))" OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT [StudentID], [Subject], [Assigment], [File], [Upload], [Time] FROM [UploadInfo]" UpdateCommand="UPDATE [UploadInfo] SET [Subject] = @Subject, [Assigment] = @Assigment, [File] = @File, [Upload] = @Upload, [Time] = @Time WHERE [StudentID] = @original_StudentID AND [Subject] = @original_Subject AND [Assigment] = @original_Assigment AND [File] = @original_File AND [Upload] = @original_Upload AND [Time] = @original_Time"> <DeleteParameters> <asp:Parameter Name="original_StudentID" Type="String" /> <asp:Parameter Name="original_Subject" Type="String" /> <asp:Parameter Name="original_Assigment" Type="String" /> <asp:Parameter Name="original_File" Type="Object" /> <asp:Parameter Name="original_Upload" Type="String" /> <asp:Parameter Name="original_Time" Type="DateTime" /> </DeleteParameters> <UpdateParameters> <asp:Parameter Name="Subject" Type="String" /> <asp:Parameter Name="Assigment" Type="String" /> <asp:Parameter Name="File" Type="Object" /> <asp:Parameter Name="Upload" Type="String" /> <asp:Parameter Name="Time" Type="DateTime" /> <asp:Parameter Name="original_StudentID" Type="String" /> <asp:Parameter Name="original_Subject" Type="String" /> <asp:Parameter Name="original_Assigment" Type="String" /> <asp:Parameter Name="original_File" Type="Object" /> <asp:Parameter Name="original_Upload" Type="String" /> <asp:Parameter Name="original_Time" Type="DateTime" /> </UpdateParameters> <InsertParameters> <asp:Parameter Name ="StudentID" Type="String" /> <asp:Parameter Name ="Subject" Type="String" /> <asp:Parameter Name ="Assigment" Type="String" /> <asp:Parameter Name ="File" Type="Object" /> <asp:Parameter Name ="Upload" Type="String" /> <asp:Parameter Name ="Time" Type="DateTime" /> </InsertParameters> </asp:SqlDataSource> <table class="style1"> <tr> <td class="style3"> <asp:Button ID="Button1" runat="server" Text="Confirm" Width="68px" style="height: 26px" /> </td> <td> &nbsp;</td> </tr> <tr> <td class="style3"> &nbsp;</td> <td> &nbsp;</td> </tr> </table> <br /></form> </body></html> 
Can anyone help me out?
Pleasee
Thannkss... 
 

View 2 Replies View Related

ConnectionString Property Has Not Been Initialized

Nov 18, 2005

My IT dept set up an SQL db on a server for me and I am connected to it through a port.  They told me I had to create my tables through an MS Access adp, which I have done.  I am using VWD Express and am trying to create a login page using usernames and pw's from a db table. I am connected (at least the db Explorer tab shows I am) to the MS Access adp and can drop a GridView from my Employees table from it onto a page and get results.  I keep getting the "ConnectionString property not initialized" error message pointing to my sqlConn.Open() statement and cannot figure out why.  I have looked at hundreds of posts but can't seem to find anything that works.  If someone could point me to some post or website that could explain connecting to a SQL db through a port or whatever you think I need to learn to get this fixed I would appreciate it. Web config:
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings/>
<connectionStrings>
<add name="ASPNETDB" connectionString="Description=Training;DRIVER=SQL Server;SERVER=USAWVAS27;UID=usx14611;APP=Microsoft® Visual Studio® 2005;WSID=983QD21;Network=DBMSSOCN;Address=USAWVAS27,3180;Trusted_Connection=Yes" providerName="System.Data.Odbc" />
</connectionStrings>

<system.web>
<authentication mode="Forms" />



<authorization>
<deny users="?" />
</authorization>
<customErrors mode="Off" />


</system.web>
</configuration>My login.aspx page
<%@ Page Language="VB" debug="true"%>
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="System.Configuration.ConfigurationManager" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">

Protected Sub LoginUser(ByVal s As Object, ByVal e As EventArgs)
Dim blnAuthenticate As Boolean = Authenticate(username.Text, password.Text)
If blnAuthenticate Then
FormsAuthentication.RedirectFromLoginPage(username.Text, False)
End If
End Sub
Function Authenticate(ByVal strUsername As String, ByVal strPassword As String) As Boolean

Dim strConnection As String = ConfigurationManager.AppSettings("ASPNETDB")
Tried this code as wellDim sqlConn As New SqlConnection(ConfigurationManager.AppSettings("ASPNETDB"))
Dim sqlConn As New SqlConnection(strConnection)

Dim sqlCmd As SqlCommand
Dim sqlDR As SqlDataReader
Dim userFound As Boolean
sqlCmd = New SqlCommand("SELECT * FROM Employees " & _
"WHERE username='" & strUsername & " ' AND password='" & strPassword & "'", sqlConn)



sqlConn.Open()
sqlDR = sqlCmd.ExecuteReader()
userFound = sqlDR.Read()
sqlDR.Close()
Return userFound
End Function
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<p>Username:<asp:TextBox ID="username" runat="server"></asp:TextBox><br />
<br />
<p>Password:<asp:TextBox ID="password" runat="server"></asp:TextBox><br />
<br />
<asp:Button ID="btnSubmit" runat="server" Text="Login" OnClick="LoginUser" />&nbsp;</div>
</form>
</body>
</html>Thanks

View 5 Replies View Related

The ConnectionString Property Has Not Been Initialized

Feb 5, 2006

I have installed SQL Server 2005 Express Edition.I have defined the connectionstring in my web.config as follows:
<connectionStrings><add name="MyDB" connectionString="Server=local;Provider=SQLOLEDB;Initial Catalog=Shop;Trusted_Connection=Yes;DataSource==.SQLExpress;AttachDBFilename=Data/MyDB.mdf" providerName="System.Data.SqlClient"/></connectionStrings>Here's my vb code:
Dim connStr As String = ConfigurationManager.ConnectionStrings("MyDB").ToString()Dim DBConnection As New SqlConnectionDim SQLCmd As New SqlCommand("SELECT * FROM tblMember WHERE UserName=@UserName", DBConnection)SQLCmd.Parameters.Add(New SqlParameter("@UserName", tbUserName.Text))DBConnection.Open()and on that last line I receive the error: The ConnectionString property has not been initializedNow, I have seen SO many different versions of a connectionstring that im totally confused!!I want to use windows authentication (I know thats better for security reasons).But I have difficulties understanding the attributes required (AND THEIR MEANING!) of the connectionstring. (e.g. do I need to define DataSource or Initial Catalog or AttachDBFileName and the rest? What does it do exactely?)Also: I have registered my server as "MyServer" is that the alias I need/can use in my connectionstring?If someone could explain me the above questions it would be of GREAT help!!

View 6 Replies View Related

The ConnectionString Property Has Not Been Initialized

Apr 19, 2006

Hello, I have just begun my first web application in vs 2005.  I have a done a bit of coding in VS 2003.  I have some list boxes on the page that use an ObjectDatasource that I set up with the wizard--and they work well and connect to SQL server.  But I wanted to re use some of my old code for another list box on the page and put code in myself. 
  Dim MyConnection As SqlConnection = New SqlConnection(ConfigurationManager.AppSettings("CONN_DATAConv"))
Dim ProcConnection As SqlConnection = New SqlConnection(ConfigurationManager.AppSettings("CONN_DATAConv"))
Dim myCommand As New SqlCommand(CommandText, MyConnection)
MyConnection.Open()
ProcConnection.Open() Here is what is in the web.config   <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings/>
<connectionStrings>
<add name="DataConvConnectionString_gisad" connectionString="Data Source=PWDGIS4;Initial Catalog=DataConv;Persist Security Info=True;User ID=gisad;Password=erv11new"
providerName="System.Data.SqlClient" />

<add name="CONN_DATAConv" connectionString="Data Source=PWDGIS4;Initial Catalog=DataConv;Persist Security Info=True;User ID=gisad;Password=erv11new"
providerName="System.Data.SqlClient" />
</connectionStrings>
 Please note that I canged the connection string call from
ConfigurationSettingsAppSettings that was in vs 2003
But the connections won't open.  Any help would be greatly appreciated.
 

View 3 Replies View Related

The ConnectionString Property Has Not Been Initialized

Apr 28, 2008

Hi,

I'm writing a sample code to try to connect to my local SQL 2005 Express server and run into the following error code

*******

Exception Details: System.InvalidOperationException: The ConnectionString property has not been initialized.
*******

My app is fairly easy since I'm still a newbie to SQL


using System;

using System.Configuration;

using System.Collections;

using System.Data;

using System.Data.SqlClient;

using System.Web.Configuration;



public class MovieDataReader

{


private readonly string _conString;

public SqlDataReader GetMovies()

{


SqlConnection con = new SqlConnection(_conString);

SqlCommand cmd = new SqlCommand();

cmd.Connection = con;

cmd.CommandText = "SELECT Title,Director FROM Movies";

con.Open();

return cmd.ExecuteReader(CommandBehavior.CloseConnection);

}



public MovieDataReader()

{

SqlConnection con = new SqlConnection(@"Data Source=""ANDREW_JRSQLEXPRESS"";Integrated Security=True;Initial Catalog=Movies");

SqlCommand cmd = new SqlCommand("INSERT INTO Movies VALUES ('Steven Spielberg', 'Star War')", con);


try

{


con.Open();

cmd.ExecuteNonQuery();

}

finally

{


con.Close();

}

}

}

Can somebody please point out what I'm doing wrong here, thanks!


View 5 Replies View Related

Going Nuts - The ConnectionString Property Has Not Been Initialized - Help!

May 27, 2006

I'm struggling with the different methodologies for using DataSets in 2.0. I can knock this out in no time flat in 1.0, but am bogged down in 2.0. Can anyone guide me on the right track? My code is below. I'm forming a DataSet from a SQL Server Express database from the user's choice from a drop down. My connection string "ASOCTCOConnectionString" is declared in my web.config and used successfully throughout in the WYSIWYG configurations of my databound controls.  But I want to control this in code. This si getting frustrating and right now I'm longing for the clean simplicity I had with Web Matrix :(
In any case, any suggestions? It crashes with this error when opening the connection with MyConn.Open(). I just want to be able to configure a DataSet and apply it to my controls and results.
<code>
Dim connectionString As String = System.Configuration.ConfigurationManager.AppSettings("ASOCTCOConnectionString")
Dim MyConn As System.Data.IDbConnection = New System.Data.SqlClient.SqlConnection(connectionString)
Dim MyQuery, SearchString As String

Dim myAdapter As New System.Data.SqlClient.SqlDataAdapter
Dim myDataSet As New System.Data.DataSet
Dim mySelectCommand As New System.Data.SqlClient.SqlCommand
mySelectCommand.CommandText = "SELECT * from Device_Type where Category LIKE " & DDLDevType.SelectedItem.Text
mySelectCommand.Connection = MyConn
MyConn.Open()
Grid1.DataSource = myDataSet
Grid1.Databind()
MyConn.Close()
</code>

View 11 Replies View Related

Flat File Source And ConnectionString Property

Sep 11, 2007

Hi,
i have inherited a SSIS project that was left unfinished by a previous developer. One thing i notice with it is that all the flat file sources in the connection manager have hardcoded paths for the ConnectionString property. I would like to change this so that at least the path, and if possible the file name, are dynamic - i.e. they are determined either by parameters passed into the package when it is run or they are contained within a config file.

Is this possible? Can anyone supply a link to an article or tutorial specifically covering this?

Many thanks

View 3 Replies View Related

Changing The ConnectionString Property For A File Connection Manager

Mar 14, 2006

I have a package that I plan to run against about 700 databases to look for anomalies. I have several package variables in place that are passed in at runtime. One of them will hold the path and filename of the error log for the current database in process. I want each database to generate it's own error log for documentation and research purposes. However, when I run the package, it continues to use the path and filename that I entered when I created the File Connection Manager. I am trying to update that value in a Script Task by using the ConnectionManager class and setting the value for the "ConnectionString" property. This method is working for the OLEDB Connection Manager (which tells the package which Access database to process), but not for my File Connection Manager. Please help!

DO

View 3 Replies View Related

Error: Report Server Installation Is Not Intialized

Mar 19, 2008

Hi Experts,
I am getting this error and error message is
Error: The report Server installation is not initialized. Check the documentation for more info (rsReportServerNotActivated), The RPC server is not listening.


Can any one give me some idea how to over come the situation.

View 4 Replies View Related

SQL Error When Submitting

Jun 15, 2005

Hi all , I have a question concering submitting to a SQL database
and the error it returns. The purpose of the code is to test
connectivity to a SQL database. It works properly because I can
change the code to check and return and it does so properly. The code
for submissions is below and the elispses represent other code that I
took out to keep it short:<%@ Import Namespace="System" %><%@ Import Namespace="System.Data" %><%@ Import Namespace="System.Data.SqlClient" %><%@ Import Namespace="System.Configuration" %>
<html>
   <head>   </head>
   <script language="VB" runat=server> ...              Sub SubmitBtn_Click(Sender As Object, E As EventArgs)
          Dim DS As DataSet          Dim MyConnection As SqlConnection          Dim MyCommand As SqlDataAdapter
          MyConnection
= New SqlConnection("server=***;database=***;uid=***;pwd=***")         
MyCommand = New SqlDataAdapter("insert into certifications (name)
values ('James Fogarty')", myConnection)
          DS = new DataSet()          MyCommand.Fill(DS, "Titles")
          MyList.DataSource = DS.Tables("Titles").DefaultView          MyList.DataBind()
       End Sub   </script>
   <body>       <center>       <form action="default.aspx" method="post" runat="server">
           ...
          
<asp:button text="Save and Submit" OnClick="SubmitBtn_Click"
runat="server"/>
           ...
           <p>          
<ASP:DataGrid id="MyList" HeaderStyle-BackColor="#aaaadd"
BackColor="#ccccff" runat="server"/>       </form>       </center>   </body>
</html>
The error I get is:Object reference not set to an instance of an object.Checking the database, I can see that the values were inserted properly. Any suggestions?Thanks - James

View 17 Replies View Related

Connectionstring Error For ODBC Database

Jan 11, 2008



Hi Everyone,

First of all I don't know whether this is the right place to put my query............please guide me the right link if this is not......

I am using Sybase Server in my .net project.............

and using this connectionstring...

Driver={INTERSOLV 3.11 32-BIT Sybase};Srvr=MySybase;db=MyDatabase;Uid=admin;Pwd=admin


I can make odbc connection (in .net code) using this connectionstring.............. and fetch the data also....

But somehow I don't know why... it gives the wrong result for my stored procedure.....

stored procedure is quite big and has many statements.......... after some digging I found that it gives the correct result if we use Server Explorer like Sql server, DBArtesian etc.. (not possible to copy it here, but it gives wrong result in date calculation)

But in Visual Studio Server Explorer when I make new connection and select "Microsoft OLEDB Provider for the odbc" and put the above connection string...it gives the correct result for the tables but wrong result for the stored procedure...

I feel that there is some problem with Provider....
I am not passing any provider here so it takes MSDASQL.1...

My question is What should be my connection string here..........????

and what's provider does actually???

Thanks in Adavance......

View 6 Replies View Related

SQLConnect To SQL Server Fails When Connection Intialized From A Service

Mar 8, 2006

I have an
issue where SQL Server is refusing a connection that is initiated from
within a Windows service. The connection is attempted using the
SQLConnect ODBC function (yes I know there are newer and better things
out there but I'm stuck with ODBC for now ). SQLConnect returns
SQL_ERROR and the error code that is returned is:

28000

Invalid authorization specification
The value specified for the argument UserName or the value specified for the argument Authentication violated restrictions defined by the data source.

Now
it sounds like a username/password problem but when we attempt a
connection to the same server via a non-service program, everything
works fine (using the same username/password). We thought it might be
an ODBC issue at first but we can connect to a MySQL server using the
same programs/services just fine.

Checking the SQL Server setup, we do have both Windows accounts and SQL Server authentication enabled (under Security tab).

Anyone have any ideas?

thanks!
-Pete

View 10 Replies View Related

Submitting A Tool

Dec 10, 2002

Steve McCormick writes "I have written a stored procedure that may be used as a utility. I developed it because I keep having to replicate the content of support data tables between environments when I don't have a link and cannot use the import/export utilities. The procedure generates insert statements that replicate the content of a table. You simply provide the table name as a parameter and it generates an insert statement for each record. The insert statement is dynamic for however many columns the table has and performs appropriate conversions of data to represent how the insert statements should be written. If the table has a primary key, it encases the insert statement in an (IF NOT EXISTS) condition that checks the primary key duplication constraints before attempting the insert.
Would you be interested in this tool for your readers and if so, how do I submit it?"

View 3 Replies View Related

Clean Input Before Submitting To Database

Sep 11, 2006

Is there some recommended way to clean input before submitting it to the database? We'd like to develop a library that can be used on our ASP/ASP.NET apps to filter input before it's sent to the SQL Server and Oracle databases. Is there a way to create a .NET DLL that can be used for both ASP.NET and classic ASP apps. Thanks.

View 3 Replies View Related

Submitting Report Requests From .NET Application

Feb 13, 2007

Hi,

One of my client want to shift his reporting to SSRS. He wants to submit his report requests to SSRS. He wants the report should run at the reporting server side (not on client system) and output should be exported to a folder on server.

I am some what successful in submitting the report requests using subscriptions. But I have no idea to retrieve the requests from SSRS with the execution status.

I have to display all submitted reprot requests with execution status (success or fail) in a data grid and user selects one report to see the out file. Where can I get this information?

And how can I create a subscription that runs immediatly after submission. (without any delay)?

Help me please!!!

Thanks in advance, Gouri Sankar

View 4 Replies View Related

Changing Code Page Property Using Property Expression Doesn't Work

Jun 16, 2006

I am having problems exporting data into a flat file using specific code page. My application has a variable "User::CodePage" that stores code page value (936, 950, 1252, etc) based on the data source. This variable is assigned to the CodePage property of desitnation file connection using Property expression.

But, when I execute the package, the CodePage property of the Destination file connection defaults to the initial value that was set for "User:CodePage" variable in design mode. I checked the value within the variable during runtime and it changes correctly for each data source. But, the property of the destinatin file connection doesn't change and results in an error.

[Flat File Destination [473]] Error: Data conversion failed. The data conversion for column "Column01" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.".

[DTS.Pipeline] Error: The ProcessInput method on component "Flat File Destination" (473) failed with error code 0xC02020A0. The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running.

If I manually update the variable with correct code page and re-run the ETL, everything works fine. Just that it doesn't work during run-time mode.

Can someone please help me resolve this.

Thanks much.

View 5 Replies View Related

Value Of A Readonly Property Of Custom Task Is Not Updated In Property Window

Apr 17, 2008

Hi,

I developed a simple custom control flow component which has several read/write properties and one readonly property (lets call it ROP) whichs Get method simple returns the value of a private variable (VAR as string). In the Execute method the VAR has a value assigened. When I put the value of ROP or VAR into MsgBox I can see the correct value. However when I execute the component I can not see the value of the ROP in the property window. I see the property but its value is empty string. For example when I put a breakpoint to postexecute or check the property before click OK in a MsgBox I would expect that the property value would be updated in SSIS as well. Is there a way how to display correct values of custom tasks properties in property window?

Thanks for any hints.

View 3 Replies View Related

One Form To Update Different SQL Tables Based Upon Form Selection

Apr 16, 2008

Hello,
My company Intranet has a form that agents can use to post their comments about the company to upper management, but our customer service department would like to modify the form so that the agent has to pick from a comment type.
The dropdown options on the form will be as follows:
ComplimentsComplaintsGeneral CommentsSuggestions
Each dropdown option has a designated table in a SQL DB.Using postback on the same page, I need to change which fields of the form are visible based upon which dropdown selection the user chooses, and I need the fields to then be inserted into the table that corresponds with the dropdown selection item.
For example: If the Compliments dropdown selection is picked, I need a text box to show for the user's location, the name of the customer, account number, and the message box. Once the submit button is clicked, the characters in these boxes need to be inserted into the Compliments table using its data adapter.
However, if the user selects Suggestions, the name of the customer and the account number should not be visible, since these fields do not exist and when the submit button is pressed, the Suggestions table should be updated.
If you need more information, I will provide whatever is needed.
As always, thanks for everyone's assistance.
Chris

View 3 Replies View Related

(URGENT) Cannot Be Written To The Property. The Expression Was Evaluated, But Cannot Be Set On The Property

May 7, 2008

Untill recently I had a smooth running SSIS package,but suddenly it throws error syaing
"OnError,,,,,,,The result of the expression

"@[User:trTextFileImpDirectory] +"SomeTextStringHere"+ @[User:trANTTextFileName] +(DT_STR,30,1252) @[User:taging_Date_Key]+ "SomeTextStringHere"
" on property "ConnectionString" cannot be written to the property. The expression was evaluated, but cannot be set on the property."

I have child SSIS package running under a parent package (through execute package task)

I have few flat file connection managers in child package for text file import , in which I am building text file path dynamically at run time by assigning an expression in connection string property of connection manager.
The Expression is as follows



"@[User:trTextFileImpDirectory] +"SomeTextStringHere."+ @[User:trANTTextFileName] +(DT_STR,30,1252) @[User:taging_Date_Key]+ +"SomeTextStringHere"

Where @[User:trTextFileImpDirectory] is a variable which contains path of directory containg text
files.Value in this variable is assigned at runtime from parent package's variable,which in turns fetch
value from a configuration file on local server.

With my current configuration this path has been configured to some other server's directory over network ( I.e my package picks text files from some other servers folder over network)

While
"Some string here"+ @[User:trANTTextFileName]" part of file name string.

(DT_STR,30,1252) @[User:taging_Date_Key] Contain the date of processing ,value in this variable is also picked up at run time from parent package variable.

1) So can someone give me some insight into possible reason of failures.
2) Is it possible that problem arises if directory (from which I m picking text files) is assigned password or is there exist some problem in accessing forlders over network ?
3) Or there can be some problem in package configuration at design time( I.e where I m assigning value in variable from parent package vriables)?




View 10 Replies View Related

Updating Database From Form Error Message

Jan 19, 2005

I am getting an error message when trying to up to update a database from a form. It appears a simple looking error but I can't seem to see what the problem is
Any ideas would be appreciated

This is the error message
Line 1: Incorrect syntax near '('.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Line 1: Incorrect syntax near '('.

Source Error:


Line 95: sqlConnection.Open
Line 96: Try
Line 97: rowsAffected = sqlCommand.ExecuteNonQuery
Line 98: Finally
Line 99: sqlConnection.Close


Source File: D:Webspacewebs4cInetpubwwwrootkerslakeAdminUpdate.aspx Line: 97

Stack Trace:


[SqlException: Line 1: Incorrect syntax near '('.]
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +742
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +194
ASP.Update_aspx.Update(Int32 lifestyleID, String clientFirstName, String clientSurname, String clientStreet, String clientTown, String clientState, String clientPhone, String clientMOB, String clientEmail, Int32 methodContact, String occupation, String selfEmployed, String company, String address, String other, String progress, DateTime lastUpdate, String dOB, String prefferedTime) in D:Webspacewebs4cInetpubwwwrootkerslakeAdminUpdate.aspx:97
ASP.Update_aspx.Update(Object Source, EventArgs E) in D:Webspacewebs4cInetpubwwwrootkerslakeAdminUpdate.aspx:321
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1292

THIS IS THE CODE>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Function Update( _
ByVal lifestyleID As Integer, _
ByVal clientFirstName As String, _
ByVal clientSurname As String, _
ByVal clientStreet As String, _
ByVal clientTown As String, _
ByVal clientState As String, _
ByVal clientPhone As String, _
ByVal clientMOB As String, _
ByVal clientEmail As String, _
ByVal methodContact As Integer, _
ByVal occupation As String, _
ByVal selfEmployed As String, _
ByVal company As String, _
ByVal address As String, _
ByVal other As String, _
ByVal progress As String, _
ByVal lastUpdate As Date, _
ByVal dOB As String, _
ByVal prefferedTime As String) As Integer
Dim connectionString As String = "server='202.xxxxxxx; user id='webs4c'; password='xxxxxxx'; database='xxxx'"
Dim sqlConnection As System.Data.SqlClient.SqlConnection = New System.Data.SqlClient.SqlConnection(connectionString)
Dim queryString As String = "UPDATE [Lifestyle] ([LifestyleID], [ClientFirstName], [ClientSurname], [ClientStr"& _
"eet], [ClientTown], [ClientState], [ClientPhone], [ClientMOB], [ClientEmail], [M"& _
"ethodContact], [Occupation], [SelfEmployed], [Company], [Address], ["& _
"Other], [Progress], [LastUpdate], [DOB], [PrefferedTime]) VALUES "& _
"(@UserID, @ClientFirstName, @ClientSurname, @ClientStreet, @ClientTown, @ClientS"& _
"tate, @ClientPhone, @ClientMOB, @ClientEmail, @MethodContact, @Occupation, @Self"& _
"Employed, @Company, @Address, @Other,@Progress, @LastU"& _
"pdate, @DOB, @PrefferedTime WHERE ([Lifestyle].[L"& _
"ifestyleID] = @LifestyleID)"

Dim sqlCommand As System.Data.SqlClient.SqlCommand = New System.Data.SqlClient.SqlCommand(queryString, sqlConnection)

sqlCommand.Parameters.Add("@LifestyleID", System.Data.SqlDbType.Int).Value = lifestyleID
sqlCommand.Parameters.Add("@ClientFirstName", System.Data.SqlDbType.NVarChar).Value = clientFirstName
sqlCommand.Parameters.Add("@ClientSurname", System.Data.SqlDbType.NVarChar).Value = clientSurname
sqlCommand.Parameters.Add("@ClientStreet", System.Data.SqlDbType.NVarChar).Value = clientStreet
sqlCommand.Parameters.Add("@ClientTown", System.Data.SqlDbType.NVarChar).Value = clientTown
sqlCommand.Parameters.Add("@ClientState", System.Data.SqlDbType.NVarChar).Value = clientStreet
sqlCommand.Parameters.Add("@ClientPhone", System.Data.SqlDbType.NVarChar).Value = clientPhone
sqlCommand.Parameters.Add("@ClientMOB", System.Data.SqlDbType.NVarChar).Value = clientMOB
sqlCommand.Parameters.Add("@ClientEmail", System.Data.SqlDbType.NVarChar).Value = clientEmail
sqlCommand.Parameters.Add("@MethodContact", System.Data.SqlDbType.Int).Value = methodContact
sqlCommand.Parameters.Add("@Occupation", System.Data.SqlDbType.NVarChar).Value = occupation
sqlCommand.Parameters.Add("@SelfEmployed", System.Data.SqlDbType.NVarChar).Value = selfEmployed
sqlCommand.Parameters.Add("@Company", System.Data.SqlDbType.NVarChar).Value = company
sqlCommand.Parameters.Add("@Address", System.Data.SqlDbType.NVarChar).Value = address
sqlCommand.Parameters.Add("@Other", System.Data.SqlDbType.NVarChar).Value = other
'sqlCommand.Parameters.Add("@DateEnquiry", System.Data.SqlDbType.DateTime).Value = dateEnquiry
sqlCommand.Parameters.Add("@Progress", System.Data.SqlDbType.NVarChar).Value = progress
sqlCommand.Parameters.Add("@LastUpdate", System.Data.SqlDbType.DateTime).Value = lastUpdate
sqlCommand.Parameters.Add("@DOB", System.Data.SqlDbType.NVarChar).Value = dOB
sqlCommand.Parameters.Add("@PrefferedTime", System.Data.SqlDbType.NVarChar).Value = prefferedTime

Dim rowsAffected As Integer = 0
sqlConnection.Open
Try
rowsAffected = sqlCommand.ExecuteNonQuery
Finally
sqlConnection.Close
End Try

Return rowsAffected
End Function

END CODE

View 2 Replies View Related

Error 7965 Not A Valid Recordset Property

Jul 23, 2005

Dear All,(No aswers on access newsgroups)Access2000.adp connected to SQL-server 2000MainForm unbound: seachform on companies meeting a complex combination ofcriteria.SubFrom and ListBox to display the searchresult ( 2 outputs to test what'sbest).Searchresult is stored in a creatable ADO-recordset (see code) and then1. Converted to string (GetString) to be set as valuelist for a listbox.2. bound to the subform.The Listbox shows the resultdata correctly but is limited in length.The subform shows the records but all fields are empty or displays #errorHow should I bound the controls correctly to display the fieldvalues?If I let them unbound the show up empty.If I set them to the recordsets' fieldnames it show #error.On my Notebook using MSDE there is no errormessageOn my Desktop i get error 7965 not a valid recordset property.CAN'T FIND WHAT'S WRONG! Cursortype ??FilipCODE'Store result in creatable ADO-recordset: Add fieldsWith ResultRSWith .Fields.Append "CompID", adInteger.Append "CompName", adVarChar, 255.Append "BasicPrice", adVarChar, 255End With.CursorLocation = adUseClient.CursorType = adOpenStatic.OpenEnd With[color=blue][color=green]>> Code for Search[/color][/color]'Set Rowsource Listbox and subformIf ResultRS.RecordCount > 0 ThenstrSearchResult = ResultRS.GetString(adClipString, , ";", ";")Me.Formulier1.Form.Visible = TrueSet Me.Formulier1.Form.Recordset = ResultRSMe.CmbSearchResult.Visible = TrueMe.CmbSearchResult.RowSource = strSearchResultEnd IfSearchEnd:'Clear memoryIf rs.State = adStateOpen Thenrs.CloseSet rs = NothingEnd IfIf ResultRS.State = adStateOpen ThenResultRS.CloseSet ResultRS = NothingEnd If

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved