Unable To Update SQL Database

May 11, 2007

I'm using a formview to display, insert and update records and it appears to be working fine except when I try to update anything. It takes the update and goes back to diaply mode but the changes aren't reflected in the data for some reason. It's like I didn't change anything at all.

Here's the SQL statement and parameters (I put elipses in to shorten it of course):...
<body>
<% 'Response.Write(Request.UserHostName)%>
<form id="form1" runat="server">
<div align=center>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:BGHelpdeskConnectionString %>"
OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT RequestID, ReqDate, ReqGSN, ReqName ... FROM tblRequests ORDER BY RequestID DESC" ConflictDetection="CompareAllValues" DeleteCommand="DELETE FROM [tblRequests] WHERE [RequestID] = @original_RequestID AND [ReqDate] = @original_ReqDate AND [ReqGSN] = @original_ReqGSN AND ... [Other] = @original_Other AND [Comments] = @original_Comments" InsertCommand="INSERT INTO [tblRequests] ([ReqDate], [ReqGSN], [ReqName], ... [Other], [Comments]) VALUES (@ReqDate, @ReqGSN, @ReqName, ... @Other, @Comments)" UpdateCommand="UPDATE [tblRequests] SET [ReqDate] = @ReqDate, [ReqGSN] = @ReqGSN, [ReqName] = @ReqName, ... [Other] = @Other, [Comments] = @Comments WHERE [RequestID] = @original_RequestID AND [ReqDate] = @original_ReqDate AND ... [Other] = @original_Other AND [Comments] = @original_Comments">
<DeleteParameters>
<asp:Parameter Name="original_RequestID" Type="Int32" />
<asp:Parameter Name="original_ReqDate" Type="DateTime" />
<asp:Parameter Name="original_ReqGSN" Type="String" />
...
<asp:Parameter Name="original_Other" Type="String" />
<asp:Parameter Name="original_Comments" Type="String" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="ReqDate" Type="DateTime" />
<asp:Parameter Name="ReqGSN" Type="String" />
<asp:Parameter Name="ReqName" Type="String" />
...
<asp:Parameter Name="Other" Type="String" />
<asp:Parameter Name="Comments" Type="String" />
<asp:Parameter Name="original_RequestID" Type="Int32" />
<asp:Parameter Name="original_ReqDate" Type="DateTime" />
<asp:Parameter Name="original_ReqGSN" Type="String" />
<asp:Parameter Name="original_ReqName" Type="String" />
...
<asp:Parameter Name="original_Other" Type="String" />
<asp:Parameter Name="original_Comments" Type="String" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="ReqDate" Type="DateTime" />
<asp:Parameter Name="ReqGSN" Type="String" />
<asp:Parameter Name="ReqName" Type="String" />
<asp:Parameter Name="ReqPhone" Type="String" />
... etc

 And here's my formview:1 <asp:FormView ID="FormView1" runat="server" DataKeyNames="RequestID"
2 DataSourceID="SqlDataSource1" Width="800px" BackColor="Transparent" BorderStyle="None" OnItemInserting="FormView1_ItemInserting">
3 <EditItemTemplate>
4 <table id="Table4" cellpadding="10" cellspacing="5" class="Layout" language="javascript"
5 onclick="return TABLE1_onclick()" width="800">
6 <tr>
7 <td bgcolor="#93bde7" colspan="3" style="height: 20px; text-align: right">
8 <asp:ImageButton ID="ImageButton1" runat="server" CommandName="Update" ImageUrl="~/img/btn/check.gif"
9 ToolTip="Submit Form" />
10 <asp:ImageButton ID="ImageButton2" runat="server" CausesValidation="False"
11 CommandName="Cancel" ImageUrl="~/img/btn/x.gif" ToolTip="Cancel Request" /></td>
12 </tr>
13 <tr style="color: #000000">
14 <td rowspan="2" style="width: 400px; text-align: right" valign="top">
15 </td>
16 <td rowspan="2" style="width: 135px" valign="top">
17 Request Type:
18 <br />
19 <asp:RadioButtonList ID="RadioButtonList1" runat="server" SelectedValue='<%# Bind("ReqType", "{0}") %>'>
20 <asp:ListItem>Starter</asp:ListItem>
21 <asp:ListItem>Leaver</asp:ListItem>
22 <asp:ListItem>Mover</asp:ListItem>
23 <asp:ListItem>Ad Hoc</asp:ListItem>
24 </asp:RadioButtonList>
25 </td>
26 <td rowspan="2" style="text-align: right">
27 <img height="77" src="../img/CSBGLogoMed.jpg" width="226" /></td>
28 </tr>
29 <tr>
30 </tr>
31 </table>
32 <br />
33 <table id="Table5" cellpadding="10" cellspacing="5" class="Layout" language="javascript"
34 onclick="return TABLE1_onclick()" width="800">
35 <tr>
36 <td bgcolor="#93bde7" colspan="3" style="height: 20px">
37 </td>
38 </tr>
39 <tr>
40 <td rowspan="2" style="text-align: right; width: 264px;">
41 <asp:Label ID="Label6" runat="server" Text="Legal First Name:"></asp:Label>
42 <asp:TextBox ID="FirstNameTextBox" runat="server" Text='<%# Bind("FirstName") %>' Width="120px"></asp:TextBox>
43 <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="FirstNameTextBox">*</asp:RequiredFieldValidator><br />
44 <asp:Label ID="Label8" runat="server" Text="Known As:"></asp:Label>
45 <asp:TextBox ID="KnownAsTextBox" runat="server" Text='<%# Bind("KnownAs") %>' Width="120px"></asp:TextBox>
46 <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="KnownAsTextBox">*</asp:RequiredFieldValidator>
47 <br />
48 <asp:Label ID="Label10" runat="server" Text="Middle Name"></asp:Label>
49 <asp:TextBox ID="MiddleNameTextBox" runat="server" Text='<%# Bind("MiddleName") %>' Width="120px"></asp:TextBox> 
50  <br />
51 <asp:Label ID="Label12" runat="server" Text="Last Name:"></asp:Label>
52 <asp:TextBox ID="LastNameTextBox" runat="server" Text='<%# Bind("LastName") %>' Width="120px"></asp:TextBox>
53 <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ControlToValidate="LastNameTextBox">*</asp:RequiredFieldValidator>
54 <br />
55 <br />
56 <asp:Label ID="Label14" runat="server" Text="Global Short Name:"></asp:Label>
57 <asp:TextBox ID="GlobalShortNameTextBox" runat="server" Text='<%# Bind("GlobalShortName") %>' Width="120px"></asp:TextBox>    <br />
58 <br />
59 <asp:Label ID="Label16" runat="server" Text="Employment Type:"></asp:Label>
60 <asp:DropDownList ID="DropDown1" runat="server" SelectedValue='<%# Bind("EmpType") %>' Width=120>
61 <asp:ListItem Value="Employee ">Employee </asp:ListItem>
62 <asp:ListItem Value="Contractor">Contractor</asp:ListItem>
63 </asp:DropDownList><br />
64 <br />
65 <asp:Label ID="Label18" runat="server" Text="Contract Type:"></asp:Label>
66 <asp:TextBox ID="ContractTypeTextBox" runat="server" Text='<%# Bind("ContractType") %>' Width="120px"></asp:TextBox> 
67 <br />
68 <asp:Label ID="Label20" runat="server" Text="Agency:"></asp:Label>
69 <asp:TextBox ID="AgencyTextBox" runat="server" Text='<%# Bind("Agency") %>' Width="120px"></asp:TextBox> 
70 <br />
71 <br />
72 <asp:Label ID="Label22" runat="server" Text="Hire Date:"></asp:Label>
73 <asp:TextBox ID="StartDateTextBox" runat="server" Text='<%# Bind("StartDate") %>' Width="120px"></asp:TextBox> 
74 <br />
75 EndDate:<asp:TextBox ID="EndDateTextBox" runat="server" Text='<%# Bind("EndDate") %>' Width="120px"></asp:TextBox> 
76 </td>
77 <td rowspan="2" style="text-align: right; width: 222px;">
78 Existing Position
79 <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("ExistingPosition") %>' Width="120px" /><br />
80 Job Title:
81 <asp:TextBox ID="JobTitleTextBox" runat="server" Text='<%# Bind("JobTitle") %>' Width="120px"></asp:TextBox><br />
82 Department:
83 <asp:TextBox ID="DepartmentTextBox" runat="server" Text='<%# Bind("Department") %>' Width="120px"></asp:TextBox><br />
84 Site Location:
85 <asp:TextBox ID="SiteLocationTextBox" runat="server" Text='<%# Bind("SiteLocation") %>' Width="120px"></asp:TextBox><br />
86 <br />
87 Company Code:
88 <asp:TextBox ID="CompanyCodeTextBox" runat="server" Text='<%# Bind("CompanyCode") %>' Width="120px"></asp:TextBox><br />
89 Cost Center:
90 <asp:TextBox ID="CostCenterTextBox" runat="server" Text='<%# Bind("CostCenter") %>' Width="120px"></asp:TextBox><br />
91 <br />
92 Function Code:<br />
93 <asp:DropDownList ID="DropDown3" runat="server" SelectedValue='<%# Bind("FunctionCode") %>'>
94 <asp:ListItem Selected="True">Select one...</asp:ListItem>
95 <asp:ListItem>Commercial - Brand/Consumer Marketing</asp:ListItem>
96 <asp:ListItem>Commercial - Trade/Customer Marketing</asp:ListItem>
97 <asp:ListItem>Commercial - Marketing - Misc</asp:ListItem>
98 <asp:ListItem>Commercial - Sales - Account Mgmt</asp:ListItem>
99 <asp:ListItem>Commercial - Sales - Field Sales</asp:ListItem>
100 <asp:ListItem>Commerical - Sales - Misc</asp:ListItem>
101 <asp:ListItem>Commercial - Innovation/Activity Mgmt</asp:ListItem>
102 <asp:ListItem>Commercial - Licensing</asp:ListItem>
103 <asp:ListItem>Commerical - Franchise & Export</asp:ListItem>
104 <asp:ListItem>Commercial - Consumer Insight & Resch</asp:ListItem>
105 <asp:ListItem>Supply Chain - General</asp:ListItem>
106 <asp:ListItem>Supply Chain - QEHS (formerly Compliance)</asp:ListItem>
107 <asp:ListItem>Supply Chain - Manufacturing Indirect</asp:ListItem>
108 <asp:ListItem>Supply Chain - Distribution Indirect</asp:ListItem>
109 <asp:ListItem>Supply Chain - Procurement</asp:ListItem>
110 <asp:ListItem>Supply Chain - Manufacturing Direct</asp:ListItem>
111 <asp:ListItem>Supply Chain - Distribution Direct</asp:ListItem>
112 <asp:ListItem>Finance - Strategy</asp:ListItem>
113 <asp:ListItem>Finance - Finance</asp:ListItem>
114 <asp:ListItem>Finance - Business Process Support</asp:ListItem>
115 <asp:ListItem>Finance - Information Technology/RICS</asp:ListItem>
116 <asp:ListItem>Finance - SBS - General</asp:ListItem>
117 <asp:ListItem>Finance - SBS - HR</asp:ListItem>
118 <asp:ListItem>Finance - SBS - Finance</asp:ListItem>
119 <asp:ListItem>Finance - SBS - Customer to Cash</asp:ListItem>
120 <asp:ListItem>Finance - SBS - Corporate Services</asp:ListItem>
121 <asp:ListItem>Human Resources - Human Resources</asp:ListItem>
122 <asp:ListItem>Human Resources - Communications</asp:ListItem>
123 <asp:ListItem>Human Resources - External Affairs</asp:ListItem>
124 <asp:ListItem>Legal</asp:ListItem>
125 <asp:ListItem>Chief Executive's Committee</asp:ListItem>
126 <asp:ListItem>General Management</asp:ListItem>
127 <asp:ListItem>Science & Technology</asp:ListItem>
128 </asp:DropDownList>
129 </td>
130 <td rowspan="2" style="text-align: right">
131 <asp:Panel ID="Panel2" runat="server" Width="100%">
132 Manager:</asp:Panel>
133 <br />
134 <asp:Panel ID="Panel1" runat="server" DefaultButton="MgrNameButton" Width="100%">
135 <asp:TextBox ID="MgrNameTextBox" runat="server" Text='<%# Bind("MgrName") %>' Width="104px"></asp:TextBox>
136 <asp:Button ID="MgrNameButton" runat="server" Text="Check Name" OnClick="ValidateManager" CausesValidation="False" Font-Size="8pt" Width="72px" />
137 <asp:Label ID="MgrNameLabel" runat="server" Text="Label" Visible="False" Width="184px" Font-Size="8pt"></asp:Label></asp:Panel>
138 <br />
139  Phone:
140 <asp:TextBox ID="MgrPhoneTextBox" runat="server" Text='<%# Bind("MgrPhone") %>' Width="120px"></asp:TextBox><br />
141 Email:
142 <asp:TextBox ID="MgrEmailTextBox" runat="server" Text='<%# Bind("MgrEmail") %>' Width="120px"></asp:TextBox><br />
143 <br />
144 Alternate Manager Information:
145 <br />
146 Name:
147 <asp:TextBox ID="AltMgrNameTextBox" runat="server" Text='<%# Bind("AltMgrName") %>' Width="120px"></asp:TextBox><br />
148 Phone:
149 <asp:TextBox ID="AltMgrPhoneTextBox" runat="server" Text='<%# Bind("AltMgrPhone") %>' Width="120px"></asp:TextBox><br />
150 Email:
151 <asp:TextBox ID="AltMgrEmailTextBox" runat="server" Text='<%# Bind("AltMgrEmail") %>' Width="120px"></asp:TextBox><br />
152 <br />
153 HRAdmin:
154 <asp:TextBox ID="HRAdminTextBox" runat="server" Text='<%# Bind("HRAdmin") %>' Width="120px"></asp:TextBox></td>
155 </tr>
156 <tr>
157 </tr>
158 </table>
159 <br />
160 <table id="Table6" cellpadding="10" cellspacing="5" class="Layout" language="javascript"
161 onclick="return TABLE1_onclick()" width="800">
162 <tr>
163 <td bgcolor="#93bde7" colspan="2" style="height: 20px">
164 </td>
165 </tr>
166 <tr>
167 <td rowspan="2" style="width: 246px; text-align: right" valign="top">
168 ComputerType:
169 <asp:DropDownList ID="DropDownList2" runat="server" SelectedValue='<%# Bind("ComputerType") %>' Width=120>
170 <asp:ListItem Selected="True">Use Existing Computer</asp:ListItem>
171 <asp:ListItem>New Desktop Required</asp:ListItem>
172 <asp:ListItem>New Laptop Required</asp:ListItem>
173 </asp:DropDownList><br /> Laptop Bag:
174 <asp:CheckBox ID="CheckBox2" runat="server" Checked='<%# Bind("LaptopBag") %>' Width="120px" /><br />
175 Laptop Dock:
176 <asp:CheckBox ID="CheckBox3" runat="server" Checked='<%# Bind("LaptopDock") %>' Width="120px" /><br />
177 Monitor:
178 <asp:CheckBox ID="CheckBox4" runat="server" Checked='<%# Bind("Monitor") %>' Width="120px" /><br />
179 Printer Type:
180 <asp:TextBox ID="PrinterTypeTextBox" runat="server" Text='<%# Bind("PrinterType") %>' Width="120px"></asp:TextBox><br />
181 Long Distance:
182 <asp:CheckBox ID="CheckBox5" runat="server" Checked='<%# Bind("LongDistance") %>' Width="120px" /><br />
183 SSN5:
184 <asp:TextBox ID="SSN5TextBox" runat="server" Text='<%# Bind("SSN5") %>' Width="120px"></asp:TextBox><br />
185 SAP Midwest:
186 <asp:CheckBox ID="CheckBox6" runat="server" Checked='<%# Bind("SAPMidwest") %>' Width="120px" /><br />
187 SAP Southwest:
188 <asp:CheckBox ID="CheckBox7" runat="server" Checked='<%# Bind("SAPSouthwest") %>' Width="120px" /><br />
189 SAP Mirror:
190 <asp:TextBox ID="SAPMirrorTextBox" runat="server" Text='<%# Bind("SAPMirror") %>' Width="120px"></asp:TextBox><br />
191 SAP Approve:
192 <asp:CheckBox ID="CheckBox8" runat="server" Checked='<%# Bind("SAPApprove") %>' Width="120px" /><br />
193 Margin Minder:
194 <asp:TextBox ID="MarginMinderTextBox" runat="server" Text='<%# Bind("MarginMinder") %>' Width="120px"></asp:TextBox><br />
195 Nextel Type:
196 <asp:TextBox ID="NextelTypeTextBox" runat="server" Text='<%# Bind("NextelType") %>' Width="120px"></asp:TextBox><br />
197 MyCS:
198 <asp:CheckBox ID="CheckBox9" runat="server" Checked='<%# Bind("MyCS") %>' Width="120px" /><br />
199 Notes DB:
200 <asp:TextBox ID="NotesDBTextBox" runat="server" Text='<%# Bind("NotesDB") %>' Width="120px"></asp:TextBox><br />
201 Outlook Email:
202 <asp:CheckBox ID="CheckBox10" runat="server" Checked='<%# Bind("OutlookEmail") %>' Width="120px" /><br />
203 Dept Share:
204 <asp:TextBox ID="DeptShareTextBox" runat="server" Text='<%# Bind("DeptShare") %>' Width="120px"></asp:TextBox><br />
205 Share Point:
206 <asp:CheckBox ID="CheckBox11" runat="server" Checked='<%# Bind("SharePoint") %>' Width="120px" /><br />
207 EPM:
208 <asp:CheckBox ID="CheckBox12" runat="server" Checked='<%# Bind("EPM") %>' Width="120px" /><br />
209 CliqBook:
210 <asp:CheckBox ID="CheckBox13" runat="server" Checked='<%# Bind("CliqBook") %>' Width="120px" /><br />
211 VPN:
212 <asp:CheckBox ID="CheckBox14" runat="server" Checked='<%# Bind("VPN") %>' Width="120px" /><br />
213 Other:
214 <asp:TextBox ID="OtherTextBox" runat="server" Text='<%# Bind("Other") %>' Width="120px"></asp:TextBox><br />
215 </td>
216 <td colspan="1" rowspan="2" style="text-align: right" valign="top">
217 Comments:
218 <br />
219 <asp:TextBox ID="CommentsTextBox" runat="server" Height="367px" Text='<%# Bind("Comments") %>'
220 Width="486px" TextMode="MultiLine" BorderStyle="Solid" BorderWidth="1px"></asp:TextBox><br />
221 <br />
222 </td>
223 </tr>
224 <tr>
225 </tr>
226 <tr>
227 <td background="../img/csbanner.jpg" bgcolor="#93bde7" colspan="2" rowspan="1" style="text-align: left">
228 <asp:ImageButton ID="ImageButton3" runat="server" CommandName="Update" ImageUrl="~/img/btn/check.gif"
229 ToolTip="Submit Form" /> <asp:ImageButton ID="ImageButton4" runat="server" CausesValidation="False"
230 CommandName="Cancel" ImageUrl="~/img/btn/x.gif" />
231 </td>
232 </tr>
233 </table>
234 <asp:ValidationSummary ID="ValidationSummary1" runat="server" BackColor="Yellow"
235 DisplayMode="SingleParagraph" Font-Bold="True" HeaderText="Please fill in the fields indicated with a red asterisk (*)"
236 Width="800px" />
237 </EditItemTemplate>
238 <InsertItemTemplate>
239 ...
240 </InsertItemTemplate>
241 <ItemTemplate>
242 ...
243 </ItemTemplate>
244 </asp:FormView>
 

View 7 Replies


ADVERTISEMENT

Unable To Update The Data

Feb 3, 2006

Hi,

I am not able to modify(add rows into) a table present in sql server from my vb.net application. I am using sql server 2005 enterprise edition and vs.net 2003. are they compatible?

thanks for your help..

View 5 Replies View Related

Unable To Update A Table From A Web Page.

Jan 18, 2008

In my web page(.Net/c#) , I  want to update few fields of a database table. The code is fine. The stored procedure through which I perform the execution is fine. I'm confidently saying this is because, if I try to do the update direclty while executing the stored procedure, it gets updated. I'm facing a weird problem while trying to update the fields from my web page. When I make an update and submit it, the first time it shows the updated value in the screen. But if I try to refresh it or redisplay the data ( I guess whenever it makes a trip to the database), the old values gets populated instead of the new values. I tried debugging it, but everything seems to be working fine. I looked up the execution in SQL Profiler, everything seems to be fine. I've no clue what's going on. I've proper  permissions to make an update. So there is no permission issue. Could someone tell me how to handle this issue and what might be the possible problem which makes the values not update in the database?

View 8 Replies View Related

Unable To Update SQL Table From A Web Form

Jan 20, 2006

I have a Table which stores data from two different databases. To update it I made a Web Form that opens a single record where you can edit the data (using TextBox). Then there is an Update Button, which is supoused to Update that record in the SQL Database. However, for some reason it does not work. I get no error and every thing seems to work fine, but the data is not updated. When running the same UPDATE statment in the SQL Query Analyzer everything works just fine. Here is the code for the button click (For test purpose I've set a spesific record to update the Task cell to "Test" and I've adde a DataGrid to be able to see if something is happening):
Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click
Dim objConnection As SqlConnection
Dim objDataAdapter As SqlDataAdapter
Dim objDataSet As DataSet
Dim objDataView As DataView
Dim strConnect As String
Dim strSQL As String
Dim strUpdate As String
strConnect = "Persist Security Info=False;Integrated Security=SSPI;server=SRV01;database=DB1"
strSQL = "SELECT * FROM Users WHERE UserID ='" & Request.QueryString("UserID") & "'"
strUpdate = "UPDATE Users SET Task = 'Test' WHERE UserID = 36"     '" & Request.QueryString("UserID") & "'"
objConnection = New SqlConnection(strConnect)
objDataAdapter = New SqlDataAdapter(strSQL, objConnection)
objDataAdapter.UpdateCommand = New SqlCommand(strUpdate)
objDataSet = New DataSet
objDataAdapter.Fill(objDataSet, "User")
objDataView = New DataView(objDataSet.Tables("User"))
dgrTest.DataSource = objDataView
dgrTest.DataBind()
objDataAdapter.ContinueUpdateOnError = True
Try
objDataAdapter.Update(objDataSet, "User")
lblTest.Text = objDataAdapter.UpdateCommand.CommandText
Catch ex As Exception
lblTest.Text = "Error"
End Try
End Sub
 
Thank you for your much needed help in advance.
 

View 3 Replies View Related

Unable To Update An Identity Column

Dec 24, 2007

Hello,

I have a frustrating problem occuring in Sql 2005. We have the need
in a few client upgrade situations to update the indentity column of a common
resource table. It is populated each release with common records and the
keys got out of sync for two releases due to developer error.

In Oracle this is not a problem. In SQL we get the message "Cannot
update identity column 'mycolumn'". To get around this in SQL 2000 we
updated the table by running the following.

exec sp_configure 'allow update', 1
go
reconfigure with override
go
update syscolumns set colstat = colstat - 1
where id = object_id(Event')
and name = 'EventKey'
go
exec sp_configure 'allow update', 0
go
reconfigure with override
go


In SQL 2005 this gives us the error

'Ad hoc updates to system catalogs are not allowed'.

Now I understand the need to keep people out of the system tables.
However, can I have some sort of solution to this problem. I'm running a
bunch of ad hoc queries to update the values and I don't want to create an
exact duplicate of the table and copy over the information with the changes.
It is much easier to run a simple update.

Please advise...

Thanks,
Russ

View 4 Replies View Related

Unable To Update Variables Within A Package

Aug 1, 2007

Okay.

Be patient with me I am a relative newbie to all this.

Trying to develop a very simple package to update data in daily chunks from one server to another. Now my first step was to obtain the last date in my currenttable which I have a SQL task as my first operation. This brings back the last date for which I have data stored, all fine and dandy. I am then taking the single row result set, datetime data type, and feeding this to a variable.

My problem is my variable does not update, it just sits there and unusually for a variable, doesn't vary at all. Now we have an old hand with SSIS who tells me I'm doing nothing wrong and is equally puzzled. I have tried all datatype combinations and I'm getting nowhere fast.

Any help would be greatly appreciated.

The server is running:

Windows 2003 R2 SP1
SQL Server 2005 SP1


The server has also been configured as the DNS server.


Many Thanks

Geoff.

View 8 Replies View Related

Unable To Update SQl Server 2005 SP2....

Apr 3, 2007




Hi theres,
I have installed SP2 on my server (Window server 2003 and SQl Server 2005 standard Edition both are 64 bit). But when i query SELECT @@VERSION. i got that latest installed SP is SP1.Even i have installed SP2 successfully and interactively then where m wrong(Window server have Sp2)

View 2 Replies View Related

Unable To Update Or Delete SQL Table Records

Jun 13, 2007

Hello,
I have been serching for weeks to resolve this problem.  I am new to ASP.NET and trying to make the migration from ASP which I have programmed in for years.  I am using Microsoft Visual Web Developer 2005 Express Edition and SQL Express Edtion.  I have been working through the Microsoft Video Training at http://msdn.microsoft.com/vstudio/express/beginner/learningpath/ and created a web site using Tier 3 Lesson 8 as the model.  My new web site which is a simple phone book applicaiton lets me read the table and select the record without any problem.  But the update form lets me edit but when I attempt to Apply the update I get the following error.
Server Error in '/Phonebook' Application.
ObjectDataSource 'ObjectDataSource1' could not find a non-generic method 'Update' that has parameters: FirstName, LastName, PhoneNumber, BossGroup, Department, BossPickup, ShowInPhonebook, Type, Original_FirstName, Original_LastName, Original_PhoneNumber, Original_BossGroup, Original_Department, Original_BossPickup, Original_ShowInPhoneBook, Original_Type, Original_ItemID.
Description: An unhundled expception occured during the execution of the current web request.  Please review the stack trace for more information about the error and where it originiated in the code.
The Stack Trace basiclly showes the same error as above.
Also, when I attempt to delete the record I do not get an error but the record does not delete.
What is interesting is that I can add a record so I do not believe that it is a security permissions issue.  I have the ISS Authinication Method Enable Anonymous Access set on with full control.
If anyone has any insight as to why this is occuring please let me know. 
 

View 13 Replies View Related

Unable To Update View In Sql Server 2000

Oct 18, 2005

Hi,I have an application that's running fine on development servers (weband database-sql server 2000). I'm updating a record through a thirdparty component but I don't think the component is the problem. What'shappening is that I'm updating fields that are part of view. I'm onlyupdating fields in one table of the view and this works fine in thedevelopment environment.What happens in the production environment when I try to update(using the third party component) I get the following message:"Current recordset does not support updating. This may be a limitationof the provider or of the selected locktype."As an experiment I took the same code but removed the view, leavingonly the table I want to update as the record source. In that case theupdate worked. So it seems that something in the production databasedoesn't like me updating a view. However I can do that in the databasein the development environment.The third party component is dbnetgrid which works fine in thedevelopment environment. I can only conclude it's something about thedatabase that prevents me from updating this same table if it's in aview. I've talked to our DBA but he says there's no difference betweenthe databases. Any ideas would be appreciated.Neil

View 2 Replies View Related

Unable To Update Table Even After Dropping Constraint

Jan 16, 2006

In Microsoft SQL Server, I have a documents table and a table whichcategorizes the documents, which we'll call categories.I tried running UPDATE statements on the categories table previouslyand I ran into a foreign key constraint. The error given was "UPDATEstatement conflicted with COLUMN REFERENCE constraint FK..."So I got rid of the Foreign Key relationship, and tried running anUPDATE statement against the categories table again.I'm now getting the following message:'Cannot UPDATE "categories" because "documents" exists.'There must be something hanging around maintaining that relationship,but I'm not sure where it would be found.I was thinking about dropping the table and then adding it back again,but I'm not entirely sure what that would do.Any help is appreciated in advance.thanks,Geoff

View 3 Replies View Related

Unable To Update Table Using Access 2002 Front End

Jul 20, 2005

I am unable to update a table (either by opening it and entering datadirectly or through a form). I have set the recordsettype property toupdateable snapshot and have set the permissions to update inside ofthe SQL Server 2000 to checked. Unfortunately, these items have notworked. Any advice is appreciated. Thanks.Dave Christman

View 1 Replies View Related

Unable To Install SQL Server 2K5 Express From Microsoft Update

May 8, 2007

Windows Update gave a 0X65B error when installing SQL Server 2K5 Express SP2. The solution said to copy the summary.txt data below to this forum:



Time: 05/08/2007 11:06:22.102
KB Number: KB921896
Machine: WA10015USG93127
OS Version: Microsoft Windows XP Professional Service Pack 2 (Build 2600)
Package Language: 1033 (ENU)
Package Platform: x86
Package SP Level: 2
Package Version: 3042
Command-line parameters specified:
/quiet
/allinstances
Cluster Installation: No

**********************************************************************************
Prerequisites Check & Status
SQLSupport: Passed

**********************************************************************************
Products Detected Language Level Patch Level Platform Edition
Express Database Services (SQLEXPRESS) ENU SP1 2005.090.2047.00 x86 EXPRESS
Express Database Services (SQLExpress) ENU SP2 x86 EXPRESS

**********************************************************************************
Products Disqualified & Reason
Product Reason

**********************************************************************************
Processes Locking Files
Process Name Feature Type User Name PID

**********************************************************************************
Product Installation Status
Product : Express Database Services (SQLEXPRESS)
Product Version (Previous): 2047
Product Version (Final) :
Status : Failure
Log File : C:Program FilesMicrosoft SQL Server90Setup BootstrapLOGHotfixSQL9Express_Hotfix_KB921896_SQLEXPR.EXE
SQL Express Features : SQL_Data_Files,SQL_Engine,SQL_SharedTools
Error Number : 1627
Error Description : Unable to install Windows Installer MSI file
----------------------------------------------------------------------------------
Product : Express Database Services (SQLExpress)
Product Version (Previous):
Product Version (Final) : 3042
Status : Success
Log File : C:Program FilesMicrosoft SQL Server90Setup BootstrapLOGHotfixSQL9Express_Hotfix_KB921896_SQLEXPR.EXE
SQL Express Features : Client_Components,Connectivity,SDK
Error Number : 0
Error Description :
----------------------------------------------------------------------------------

**********************************************************************************
Summary
One or more products failed to install, see above for details
Exit Code Returned: 1627



Any help would be appreciated in getting this service pack installed.



Thanks,

Marty

View 5 Replies View Related

SQL Server 2012 :: Unable To Get Required Result Using Update Statement

Jun 18, 2014

I am unable to update the data using record by record below scenario.

Required output:

patient will able to Admit/Re-admit multiple times in hospital, if a patient readmitted multiple times in hospital after the first visit, first visit record will get Re-admission=0 and Index=1. This visit should cal Index_Admission of that patient. using this index_admission should calculate the 30-day readmission.

Current Output:

Calculation: From index_admission discharge date to next admit_visit date,

1) if the diff is having less than 30 days, readmission=1 and Index=0

else readmission=0 and Index=1 should be update.

For checking this every time should check using the latest index_admission discharge_date.

To get this result i written below logic, but it's updating readmission=0 and Index=1 after 30-day post discharge of using first index admission.

UPDATE Readmission
SET Index_AMI = (CASE WHEN DATEDIFF(DD, (SELECT Sub.Max_Index_Dis FROM
(SELECT Patient_ID, MAX(Discharge_Date_Time) Max_Index_Dis FROM Readmission
WHERE Index_AMI = 1 AND FPR.Patient_ID = Patient_ID GROUP BY Patient_ID) Sub)
, FPR.Admit_Date_Time) between 0 and 31 THEN 0 ELSE 1 END),

[Code] ....

Expected Result:

View 5 Replies View Related

Unable To Update Or Delete GridView Entries... Must Declare The Scalar Variable @ID1.

Jan 22, 2007

Hello,
 I am having issues and can't see any errors in my code! When attempting to delete a table entry from my SQL database, I get the error "Must declare the scalar variable "@ID1"." even though I declare it as a parameter in my code! Can anyone see an issue with my code below?1 <asp:GridView ID="GridView1" runat="server" AllowSorting="True"
2 DataSourceID="SqlDataSource1" AutoGenerateColumns="False" OnSorted="GridView1_Sorted">
3 <Columns>
4 <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
5 <asp:BoundField DataField="column1" HeaderText="CO" SortExpression="column1" />
6 <asp:BoundField DataField="column2" HeaderText="Network" SortExpression="column2" />
7 <asp:BoundField DataField="column3" HeaderText="C/S/T" SortExpression="column3" />
8 <asp:BoundField DataField="column4" HeaderText="Date Received" SortExpression="column4" DataFormatString="{0:d}" HtmlEncode="False" />
9 <asp:BoundField DataField="DESCRIPTION" HeaderText="Description" SortExpression="DESCRIPTION" />
10 <asp:BoundField DataField="column5" HeaderText="In Service Date" SortExpression="column5" DataFormatString="{0:d}" HtmlEncode="False" />
11 <asp:BoundField DataField="REMARKS" HeaderText="Remarks" SortExpression="REMARKS" />
12 <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" ReadOnly="True"
13 SortExpression="ID" />
14 </Columns>
15 </asp:GridView>
16 <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConduitConnectionString %>"
17 SelectCommand="SELECT [ID], [CO/Area] AS column1, [NW #] AS column2, [C/S/T] AS column3, [DATE REC'D] AS column4, [DESCRIPTION], [I/S DATE] AS column5, [REMARKS] FROM [Inspector Workload] WHERE ([Inspector Name] = @Inspector_Name) ORDER BY [CO/Area], [DATE REC'D]" DeleteCommand="DELETE FROM [Inspector Workload] WHERE (ID = @ID1)" UpdateCommand="UPDATE [Inspector Workload] SET [CO/Area] = @column1, [NW #] = @column2, [C/S/T] = @column3, [DATE REC'D] = @column4, [DESCRIPTION] = @DESCRIPTION, [I/S DATE] = @column5, [REMARKS] = @REMARKS WHERE ([ID] = @ID1)">
18 <SelectParameters>
19 <asp:QueryStringParameter Name="Inspector_Name" QueryStringField="Name" Type="String" />
20 </SelectParameters>
21 <DeleteParameters>
22 <asp:Parameter Name="ID" Type="Int32" />
23 </DeleteParameters>
24 <UpdateParameters>
25 <asp:Parameter Name="column1" Type="String" />
26 <asp:Parameter Name="column2" Type="Double" />
27 <asp:Parameter Name="column3" Type="String" />
28 <asp:Parameter Name="column4" Type="DateTime" />
29 <asp:Parameter Name="DESCRIPTION" Type="String" />
30 <asp:Parameter Name="column5" Type="DateTime" />
31 <asp:Parameter Name="REMARKS" Type="String" />
32 <asp:Parameter Name="ID" Type="Int32" />
33 </UpdateParameters>
34 </asp:SqlDataSource>
Thanks!Rob.

View 8 Replies View Related

Integration Services :: Unable To Update Packet Size Parameter In Connection Manager

May 22, 2015

I have an expression based project connection manager in an existing package and updating Packet Size parameter.

After update and clicking on OK, Packet Size value reverts back to 0 (which is old value). This connection manager is used by lot of Dataflow tasks in my package and recreating the connection manager and updating the reference is not a viable option.

View 2 Replies View Related

Help Send An Personal Email From Database Mail On Row Update-stored PROCEDURE Multi Update

May 27, 2008

hi need help how to send an email from database mail on row update
from stored PROCEDURE multi update
but i need to send a personal email evry employee get an email on row update
like send one after one email


i use FUNCTION i get on this forum to use split from multi update

how to loop for evry update send an single eamil to evry employee ID send one email

i update like this


Code Snippet
:

DECLARE @id nvarchar(1000)
set @id= '16703, 16704, 16757, 16924, 17041, 17077, 17084, 17103, 17129, 17134, 17186, 17190, 17203, 17205, 17289, 17294, 17295, 17296, 17309, 17316, 17317, 17322, 17325, 17337, 17338, 17339, 17348, 17349, 17350, 17357, 17360, 17361, 17362, 17366, 17367, 17370, 17372, 17373, 17374, 17377, 17380, 17382, 17383, 17385, 17386, 17391, 17392, 17393, 17394, 17395, 17396, 17397, 17398, 17400, 17401, 17402, 17407, 17408, 17409, 17410, 17411, 17412, 17413, 17414, 17415, 17417, 17418, 17419, 17420, 17422, 17423, 17424, 17425, 17426, 17427, 17428, 17430, 17431, 17432, 17442, 17443, 17444, 17447, 17448, 17449, 17450, 17451'
UPDATE s SET fld5 = 2
FROM Snha s
JOIN dbo.udf_SplitList(@id, ',') split
ON split.value = s.na
WHERE fld5 = 3

now
how to send an EMAIL for evry ROW update but "personal email" to the employee



Code Snippet
DECLARE @xml NVARCHAR(MAX)DECLARE @body NVARCHAR(MAX)
SET @xml =CAST(( SELECT
FirstName AS 'td','',
LastName AS 'td','' ,
SET @body = @body + @xml +'</table></body></html>'
EXEC msdb.dbo.sp_send_dbmail
@recipients =''
@copy_recipients='www@iec.com',
@body = @body,
@body_format ='HTML',
@subject ='test',
@profile_name ='bob'
END
ELSE
print 'no email today'


TNX

View 2 Replies View Related

UPDATE SQL Statement In Excel VBA Editor To Update Access Database - ADO - SQL

Jul 23, 2005

Hello,I am trying to update records in my database from excel data using vbaeditor within excel.In order to launch a query, I use SQL langage in ADO as follwing:------------------------------------------------------------Dim adoConn As ADODB.ConnectionDim adoRs As ADODB.RecordsetDim sConn As StringDim sSql As StringDim sOutput As StringsConn = "DSN=MS Access Database;" & _"DBQ=MyDatabasePath;" & _"DefaultDir=MyPathDirectory;" & _"DriverId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;" &_"PWD=xxxxxx;UID=admin;"ID, A, B C.. are my table fieldssSql = "SELECT ID, `A`, B, `C being a date`, D, E, `F`, `H`, I, J,`K`, L" & _" FROM MyTblName" & _" WHERE (`A`='MyA')" & _" AND (`C`>{ts '" & Format(Date, "yyyy-mm-dd hh:mm:ss") & "'})"& _" ORDER BY `C` DESC"Set adoConn = New ADODB.ConnectionadoConn.Open sConnSet adoRs = New ADODB.RecordsetadoRs.Open Source:=sSql, _ActiveConnection:=adoConnadoRs.MoveFirstSheets("Sheet1").Range("a2").CopyFromRecordset adoRsSet adoRs = NothingSet adoConn = Nothing---------------------------------------------------------------Does Anyone know How I can use the UPDATE, DELETE INSERT SQL statementsin this environement? Copying SQL statements from access does not workas I would have to reference Access Object in my project which I do notwant if I can avoid. Ideally I would like to use only ADO system andSQL approach.Thank you very muchNono

View 1 Replies View Related

Trigger To Update One Record On Update Of All The Tables Of Database

Jan 3, 2005

hi!

I have a big problem. If anyone can help.

I want to retrieve the last update time of database. Whenever any update or delete or insert happend to my database i want to store and retrieve that time.

I know one way is that i have to make a table that will store the datetime field and system trigger / trigger that can update this field record whenever any update insert or deletion occur in database.

But i don't know exactly how to do the coding for this?

Is there any other way to do this?

can DBCC help to retrieve this info?

Please advise me how to do this.

Thanks in advance.

Vaibhav

View 10 Replies View Related

Unable To Create Database

Jun 17, 2006

Hi, I need urgent help with this problem because I am unable to do any database development due to it. I am using visual web developer express edition with sql server 2005 express edition. The problem is that when I try to create a database in the app_data folder I get the following error message: "Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed".
Regards, sandy

View 1 Replies View Related

Unable To Coonect To Database

Aug 5, 2005

I have created  .aspx page which needs access to the database. I used datareader for reading the database. Everything is compiled and running, but when the page is trying to connect to database.. I'm getting the following error:
Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
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: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.Source Error:



Line 35: Dim flag As Boolean = False
Line 36: Dim connect As New SqlConnection("data source=(local);initial catalog=Northwind")
Line 37: connect.Open()
Line 38: Dim cmd As New SqlCommand("Select Lastname , EmployeeID from Northwind.Employees Where LastName='@user'", connect)
Line 39: Dim dr As SqlDataReaderPlz help me with this problem

View 2 Replies View Related

Unable To Connect To The Database

Aug 12, 2005

I just installed MSDE but when I try to connect to a database or create a new database I get the following message:"Microsoft ASP.NET Web MatrixUnable to connect to the database.General network error.  Check your network documentation.ConnectionRead (rec()).TDS buffer length too largeTDS buffer length too large"Can anyone tell me how to correct this problem?Thanks,

View 2 Replies View Related

Unable To Detach Database.

Jul 1, 2006

I need some insight if possible. I installed a new server (to replace an aging machine) with SQL 2000. After installing SQL on the new server I tried to detach a database from the old server so that I can attach it to the new instance of SQL. My problem is that when I do the process I am stopped with an error message.


“Error 8146: procedure sp_detach_db has no parameters and arguments supplied.”

This is happening with all of the user databases on the old server.


I have tried to run this using both the Query Analyzer and from the right-click menu option and both return the same error message. Any help would be greatly appreciated.


Thanks.

View 5 Replies View Related

Unable To Attach Database

May 13, 2012

i have a database wich is part of a vb.net project tha database worked fine..i wanted to change the location of the mdf file to the application folder so i copied it to that folder but then i tried to attach it to the server using the management studio right click database select attach that opened the add dialog box with the tree to locate the mdf file but the tree does not expand into the application folder and i can't get to the mdf file.so i tried to attach with attach command and i got the error message that access is denied error 5.i checked the security settings in all files and parent folders and everything seems ok

View 1 Replies View Related

Unable To Attach Database

May 11, 2004

A co-worker deleted the log file to a database that was running. At that point the database showed as suspect and stopped running. I was able to detach the database but I am unable to attach the database. I get a msg stating the logfile cannot be found would I like to create a new one. I select yes. I get the following error.

Error 1813: Could not open new database 'dbname'. CREATE DATABASE is aborted. Device activation error. The physical file name 'fullpath to the original log file' may be incorrect.

Any suggestions would be appreciated.

View 4 Replies View Related

Unable To Create New Database

Jul 10, 2007

I had a fully functioning SQL 2005 Exp install until today. All of my DBs work, Reporting Services works. But today I went to add a new DB for a DotNetNuke installation. Everything I have tried fails with the same error:

*****************************************************
TITLE: Microsoft SQL Server Management Studio Express
------------------------------
Create failed for Database 'TEST'. (Microsoft.SqlServer.Express.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.3042.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Create+Database&LinkId=20476
------------------------------
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.Express.ConnectionInfo)
------------------------------
A file activation error occurred. The physical file name 'G:TEST.mdf' may be incorrect. Diagnose and correct additional errors, and retry the operation.
CREATE DATABASE failed. Some file names listed could not be created. Check related errors. (Microsoft SQL Server, Error: 5105)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.3042&EvtSrc=MSSQLServer&EvtID=5105&LinkId=20476
------------------------------
BUTTONS:
OK
------------------------------
*****************************************************

I have looked high and low for a solution only to come up empty handed. I only hope at this moment that someone here has seen this before.

Thanks

Jason

View 1 Replies View Related

Unable To Connect To The SQl Database

Jan 14, 2008

i m having prob wiht connectivity to SQL Server Management Stdio Express. I am able to login thru only windows authentication. i changed setting to SQL authentication and windows both. i m creating the new login like security- logins - right click - new login- sqlauthentication and permission and all other opetion that i can checked i did but even though i m not able to connect. i have created a account from control panel and then try to do the same thign then it is giving me error that that login already excists. Plz help me here , it is driving me crazy. I am new in SQL Server plz help me out here.

View 1 Replies View Related

Unable To Attach The Database

Jan 23, 2008

I had to detach the database to delete the transaction log as it tookthe hole disk space.No I am trying to attach database, however I am not able to do so.The engine is asking me whether I want to continue and create new logfile. I agree to it, however then I am receiving an error:Error 1813: Could not open new database 'db_name'. CREATE DATABASEaborted. Device activation error. The physical file name 'E:SQLDatabasesMSSQLDatadb_name.ldf' may be incorrect.Then after I have message than attaching database failed.In event viewer I have:17204 :FCB::Open failed: Could not open device E:SQL DatabasesMSSQLDatadb_name.MDF for virtual device number (VDN) 0.In the error log I have:2008-01-23 10:28:59.00 spid52 Starting up database 'db_name'.Do you have any ideas where the problem is?I have never had this problem before, only now. And I didn't have thisproblem with other databases for which I have deleted the log file.

View 1 Replies View Related

Unable To Create A Database In VB

Dec 24, 2005

I've recently installed VB Express and SQL Server Express (including
Management Studio Express) on a laptop as well as a desktop PC.
Everything looks the same on both. I can create an SQL database
from VB without any problems on my laptop. However, when I try to
create a new SQL database from VB on my desktop, I get the following
message:

"Failed to generate a user instance of SQL Server due to a failure in
starting the process for the user instance. The connection will be
closed."



I've written a number of databases in Access, but never used SQL Server. This is about to drive my crazy.



Thanks.

View 1 Replies View Related

Unable To Attach The Database

Jan 23, 2008

I had to detach the database to delete the transaction log as it took
the hole disk space.


No I am trying to attach database, however I am not able to do so.


The engine is asking me whether I want to continue and create new log
file. I agree to it, however then I am receiving an error:


Error 1813: Could not open new database 'db_name'. CREATE DATABASE
aborted. Device activation error. The physical file name 'E:SQL
DatabasesMSSQLDatadb_name.ldf' may be incorrect.


Then after I have message than attaching database failed.


In event viewer I have:


17204 :
FCB:pen failed: Could not open device E:SQL DatabasesMSSQLData
db_name.MDF for virtual device number (VDN) 0.


In the error log I have:
2008-01-23 10:28:59.00 spid52 Starting up database 'db_name'.


Do you have any ideas where the problem is?
I have never had this problem before, only now. And I didn't have this
problem with other databases for which I have deleted the log file.

View 10 Replies View Related

Unable To Connect To SQL Server Database.

Apr 6, 2007

hi,
im making a log in using the asp.net web site admin tool the probably
is when click n the security tab it says it cannt connect to the
aspnetsqlprovider. thanksdomal 

View 1 Replies View Related

Unable To Acess Database In Webpages.

Jun 8, 2007

 Hello,I am unable to access SQL Server 2005 (Express Edition) when i am creating wesites on localhost.But the same database can be accessed without any problem when websites are created on local file system.When creating the website on localhost and trying to access databse the following error is displayed: "
Failed
to generate a user instance of SQL Server due to a failure in starting the
process for the user instance. The connection will be closed."Anyone plz help me out of this? Thanks.Ashu. 

View 13 Replies View Related

Unable To Attach SQLExpress Database

Jul 13, 2007

 This is by FAR, the most frustrating problem I have dealt with for a while.I have a project containing a SqlExpress database that I created in Visual Studio 2005. Everything works perfectly on my development machine. However, upon copying the site up to the webserver, I get an error stating:An attempt to attach an auto-named database for file
D:ContentwwwFMakerApp_DataClassAd.mdf failed. A database with the
same name exists, or specified file cannot be opened, or it is located
on UNC shareI have read almost every article/forum post that resulted from a search with google. I also searched these forums, to no avail.Note - SQLExpress had just been downloaded and installed on the server, so it wasn't being used yet. Server is Windows Server 2003. Here are the following steps I have already taken:Used SSEUTIL.EXE to verify that another database of the same name was not already attachedUninstalled & reinstalled SQLExpress multiple timesTemporarily granted 'Full Control' permissions to 'Everyone' on the site folder to verify that it was not a permissions issue.Created a very simple website, with a new database, one page - with one listbox control, and a sqldatasource. Got the exact same error. Should rule out a problem with my application.Tried various flavors of the web.config connection string.Probably other stuff that I forgot about, but will add if I remember.The only things I could imagine being wrong are either a problem with my connectionString, or the fact that SQLExpress is installed on C:, and webstuff is on D: (Wasn't able to install SqlExpress to D: for some reason)Connection String  <connectionStrings> <add name="ClassAdConnectionString" connectionString="Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|ClassAd.mdf;Integrated Security=true;User Instance=True" providerName="System.Data.SqlClient" /> </connectionStrings>  So I have had like 12 strokes today. If anybody could help me get this fixed, I will spread tales of your awesomeness throughout the landsI have included some extra info below in case it is needed. Thanks, Adam.Entire Error An attempt to attach an auto-named database for file
D:ContentwwwFMakerApp_DataClassAd.mdf failed. A database with the
same name exists, or specified file cannot be opened, or it is located
on UNC share.



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:
An attempt to attach an auto-named database for file
D:ContentwwwFMakerApp_DataClassAd.mdf failed. A database with the
same name exists, or specified file cannot be opened, or it is located
on UNC share.

Source Error:




Line 1705: }Line 1706: ClassAd.CategoriesDataTable dataTable = new ClassAd.CategoriesDataTable();Line 1707: this.Adapter.Fill(dataTable);Line 1708: return dataTable;Line 1709: }







Source File: c:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Filesforms9d7c504b4b8a576eApp_Code.3dq8tdsl.9.cs    Line: 1707


Stack Trace:




[SqlException (0x80131904): An attempt to attach an auto-named database for file D:ContentwwwFMakerApp_DataClassAd.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +739123 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1956 System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +33 System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +170 System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +349 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +181 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +359 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66 System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +496 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105 System.Data.SqlClient.SqlConnection.Open() +111 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +121 System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) +162 System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) +107 ClassAdTableAdapters.CategoriesTableAdapter.GetCategoriesByPropCode(String PropCode) in c:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Filesforms9d7c504b4b8a576eApp_Code.3dq8tdsl.9.cs:1707[TargetInvocationException: Exception has been thrown by the target of an invocation.] System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) +0 System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) +72 System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +358 System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +29 System.Web.UI.WebControls.ObjectDataSourceView.InvokeMethod(ObjectDataSourceMethod method, Boolean disposeInstance, Object& instance) +482 System.Web.UI.WebControls.ObjectDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +2040 System.Web.UI.WebControls.ListControl.OnDataBinding(EventArgs e) +92 System.Web.UI.WebControls.ListControl.PerformSelect() +31 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82 System.Web.UI.WebControls.ListControl.OnPreRender(EventArgs e) +26 System.Web.UI.WebControls.ListBox.OnPreRender(EventArgs e) +9 System.Web.UI.Control.PreRenderRecursiveInternal() +77 System.Web.UI.Control.PreRenderRecursiveInternal() +161 System.Web.UI.Control.PreRenderRecursiveInternal() +161 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360 

View 1 Replies View Related

Unable To Connect To SQL Server Database

Aug 13, 2007

 Hello all,I try to configure the website by using the built in tool of vs2005. When i click the  button from Website -> ASP .NET Configuration.when the main page is displayed, i clicked the security, the error shows like:---------------------------------------- There is a problem with your selected data store. This can be caused by an
invalid server name or credentials, or by insufficient permission. It can also
be caused by the role manager feature not being enabled. Click the button below
to be redirected to a page where you can choose a new data store. The following message may
help in diagnosing the problem: Unable to connect to SQL Server database.---------------------------------------How to enable connection to sql server? Thanks  

View 5 Replies View Related







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