EDIT: Nevermind.... New Database Problems
Mar 16, 2007
I created a new database all by myself today! (I'm so proud)
Unfortunately, I think I missed a step. I created a new table,
and when I go to insert data into it, I get this error:
"An explicit value for the identity column in table
"BLAH" can only be specified when a column list is used and IDENTITY_INSERT is ON"
HUH?
EDIT: nevermind... I'm an idiot. Can't insert values into the IDENTITY field
View 1 Replies
ADVERTISEMENT
Nov 16, 2007
I have a Win 2003 running SQL 2005 Workgroup on a hosted site. I have full access to all servers. I am trying to create a linked server to my old SQL 7 server on a Win 2000 server in another network. I can ping the Win 2000 server from the Win 2003 server. I can connect via VPN from the Win 2003 server to the other network firewall and create a linked server to an AS400 server at 192.168.1.50. On the internal network behind the firewall the Win 2000 server is at 192.168.2.133 and natted to 10.10.50.133 via a load balancer. I cannot ping the Win 2000 server over the VPN even if I add an entry to the hosts file.
The SQL 7 server is autostarted with agent and MSDTC autostarted under SQL/NT authority under the administrator account. I allow remote servers to connect via RPC.
I know just enough to be dangerous and have researched this to death. I need a little help with this. I keep getting "could not open a connection to SQL Server [53]" and have researched that to no end. On the SQL 2005 management studio to create a linked server I use Microsoft OLE DB provider for SQL Server and SQLNCLI. I can't determine the connection string so I leave that blank.
View 9 Replies
View Related
Oct 9, 2004
Hello,
I have been working in ASP.Net web sites with Access database.
Now I want to create a web site using an MS SQL database.
What software or softwares can I use to create and edit MS SQL databases?
I am using Windows XP Professional SP2.
Thank You,
Miguel
View 5 Replies
View Related
Jul 23, 2005
Greetings,Are there any tools freely available to modify or edit a .mdf databasefile? As far as seeing the actual tables?Regards,cd
View 6 Replies
View Related
Mar 27, 2008
Hi, I would create a vb2005 application that allow me to edit a sdf database stored into a pda connected at pc with activesyn directly on my desktop as well as "SQLCE Database View".
How can i do it??
Please help me
View 1 Replies
View Related
Jun 18, 2006
hi
i have a database with a table with several columns:
ID - primery key
customer
company
now lets say i want to edit one row in the database and i have the primery key ID for that row. so i click on that row (which is displayed in a gridview) when i click I want the text that is in the customer cell to appear in a textbox1 and the same with compeny text I want it to apear in another textbox2.
so what code can i write in the GridView1_SelectedIndexChanged eventhandler to populate the textboxes?
thank you
View 3 Replies
View Related
Jul 11, 2006
I'm relatively new to administering SQL Server, hence this basic question.
What are the standard practice tool(s)/methods for allowing users access to a database to edit data? In this case, these are engineers (not programmers) that need to edit some values. The practice in the past has been to install Enterprise Manager on their PC. However, this does not seem proper to me and I was thinking more along the lines of having them use Access instead.
I compare Enterpise Manager in SQL Server as an equilvalent to Enterprise Manager in Oracle - these are tools only for use by database administrators. Is this a correct correlation, or is Enterpise Manager in SQL Server a tool that users (and programmers?) are commonly allowed to use? In the case of common users, I would think not.
Thanks in advance.
View 3 Replies
View Related
Apr 8, 2008
anyone know how to delete diagram in database that show relationship between tables?or anyone know how to open the existing relation diagram and existing query in database?wonder why my sqlexpress which come wit visual basic web developer 2005 only hav new query button and new diagram button~dont have edit exisiting diagram or edit existing query~==.=~~hope someone help me~
View 3 Replies
View Related
Jan 23, 2004
Greetings all,
Is theyr an Graphical edit interface for the MSDE 2000 A database ? Windows based would be best.
Tnx for the answer.
Greetz,
Stefan
View 3 Replies
View Related
Jan 25, 2006
Sorry about my English, it is not my natural language and thanks for your help. I have installed the Personal Site Starter Kit, everything work perfect except register users. When a new user try to register as a new user he receives an error, caused because the database is "read-only". In IIS the database has read and writing permissions and the directories where the aplication is. How can I change the database permissions?
Server Error in '/personalweb' Application.
Failed to update database "C:INETPUBWWWROOTPERSONALWEBAPP_DATAASPNETDB.MDF" because the database is read-only.
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: Failed to update database "C:INETPUBWWWROOTPERSONALWEBAPP_DATAASPNETDB.MDF" because the database is read-only.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:
[SqlException (0x80131904): Failed to update database "C:INETPUBWWWROOTPERSONALWEBAPP_DATAASPNETDB.MDF" because the database is read-only.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +857466
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +735078
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1838
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +149
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +886
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +132
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +415
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +135
System.Web.Security.SqlMembershipProvider.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object providerUserKey, MembershipCreateStatus& status) +3612
System.Web.UI.WebControls.CreateUserWizard.AttemptCreateUser() +305
System.Web.UI.WebControls.CreateUserWizard.OnNextButtonClick(WizardNavigationEventArgs e) +105
System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e) +453
System.Web.UI.WebControls.CreateUserWizard.OnBubbleEvent(Object source, EventArgs e) +149
System.Web.UI.WebControls.WizardChildTable.OnBubbleEvent(Object source, EventArgs args) +17
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +115
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +163
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
View 1 Replies
View Related
Feb 7, 2006
What's the best practice for adding / editing a record into a database with lots of fields ?I am not talking about the mechanics of it, as there are a lot of trivial examples using ADO.NET, stored procs, etc.
Deleting is easy, you just pass in (a few) primary key/keys to uniquely identify the record.
But in the real world when you have, say, a table with 100 fields! Do you code the INSERT sproc by hand, with 100 parameters... then call it with your ADO.NET code ? sounds like a lot of work to me...
What about updating! That's even worst, sometimes you may need to update only 3 or 4 fields, but using sprocs you would have to pass the whole 100 parameters in again, and "update" the whole record (when in fact you are only changing 3 or 4 fields).
With the update i could write different sprocs targeting only the fields i wish to update, but that sounds like duplicating work, vs having one generic update proc.
Sometimes i just feel like bypassing sprocs and having inline sql as it would be less work... but i know it is untidy.. and more potential to be buggy.
So come on guys (and gals)... let's hear your thoughts on how you would handle the insert / update scenarios when you have lots of fields ? Northwind examples are too trivial :-)
View 1 Replies
View Related
Aug 25, 2007
Hi everyone, this is is my first post, so please reply and help.
I'm working on a project right now that uses asp 2.0 and SQL server 2005 express edition. This is a general idea of the project. In our company some of us receive ECO notifications (engineering change orders) for our products and we need to implement these to the test scripts that are on the production floor. So the project is about entering the new ECO into a database which will send an automatic notification to our test team. When they receive the notification they will have to sign in to the website and introduce their login and password to sign off the ECO (Following some checkpoints already defined by me, for example, Area ready, Test script modification necessary, new firmware introduction, comments, etc...) but I also need to record WHO and WHEN sign that ECO. We have 3 different test areas in our factory: Electrical, Functional and Systems, so all THREE areas must be signed off in order to the ECO go to a IMPLEMENTED state (at this point i need to send a new email saying that the eco has been implemented in all three areas).
So far I've completed the following things:
-users validation (logins, areas)
-New custom entry form for the ECOs and automatic email notification (part of what I did is described below). Dim ECODataSource As New SqlDataSource()ECODataSource.ConnectionString = ConfigurationManager.ConnectionStrings("ECO_ICSConnectionString1").ToString()
ECODataSource.InsertCommandType = SqlDataSourceCommandType.StoredProcedure
ECODataSource.InsertCommand = "EcoNew"
ECODataSource.InsertParameters.Add("EcoNumber", EcoNumberTextBox.Text)
ECODataSource.InsertParameters.Add("EcoDescription", EcoDescriptionTextBox.Text)
ECODataSource.InsertParameters.Add("EcoMandatory", EcoMandatoryDropDownList.Text)
-Depending on which test area is the the engineering from, I can filter the ECOs and just shows the ones that their test area is pending. (using GridView)
But I'm stuck right now when the engineers have to sign the ECO for their test areas. I was able to use the Gridview and DetailsView to EDIT most of the things that I need. But there are somethings that I don't like:
1. When using the EDIT option on Gridview or Detailsview, all fields can be edited including ECO number, description and mandatory, which I don't want them to change. If I set those columns to read only, when editing that row again. It gives me an error that says that the ECOnumber can't be NULL, but if I remove these 3 columns the Engineer will not know which ECO they have sign. They are only going to be able to see the EcoId, which doesn't say much.
2. Also I saw that I wasn't able to do is to enter the USER login and CURRENT system date and time automatically. I don't want them to manually enter the date and their login manually.
3. Finally, when the last area signs the ECO, I want to update that record and set a flag that tells me that the ECO has been completed.
So what I really want is to create some sort of form (textboxes, labels, checkboxes, etc.) that will UPDATE the selected ECO from the gridview for instance. So when I select the row from the GridView, It will show the data (Econumber, description and mandatory as READ ONLY) and use the rest of the things as INPUT for the engineer to complete. At the end an "update button" and when I click it, It will enter/update the data on that specific row, but including the time and user login as well.
Also to check if the other 2 areas have signed and if so, change the ECOReadiness flag to 1 and send the email.
Is there a code like the one I used above to do this ? Or if you think there a better way to do this, I'll be very glad to hear it.
I'm new using sql and asp, so If i'm asking some dumb questions please forgive me. .
Here's my table definition for your reference:
EcoId - primary key.
EcoNumber
EcoDescription
EcoMandatory
EcoReadiness <- Flag for the entire ECO, when ALL 3 areas have signed, this will be 1.
ATE < - Flag for Electrical area.
ATEscripts < - Just a Yes/no input.
ATEengineer <- user login
ATEdatetimestamp <- Date.Now()
FAT < - Flag for functional.
FATscripts
FATengineer
FATdatetimestamp
SYSTEMS < - Flag for systems.
SYSTEMSscripts
SYSTEMSengineer
SYSTEMSdatetimestamp
THANKS IN ADVANCE,
Regards,
Jesus
View 2 Replies
View Related
Dec 2, 2007
Using ASP.net 2.0 or Visual Web Developer Edition 2005 I could not find a single example with Datagrid Control or Form View Control, to achieve the basic functionality ofAdd/Edit/Delete Records with Remote SQL Server 2000 Database. When I searched for these examples I found many videos and examples using local database and in learning path of Visual web express editions, very goodexamples and videos using local SQL Server 2005 database, BUT not with the remote database.
My question Is it possible to get the basic functionality of Add/Edit/Delete Records with Remote SQL Server 2000 Database using ASP.Net 2.0 Datagrid and FormView controls?
This question looks like, a lazy developer question!! but, in my learning path I found GREAT videos in Visual Studio Web Developer Express edition and learned simple way of drag and drop the controls assign create local database and their connections, and few clicks to add/edit/delete records using datagrid and formview controls. In real life those are not much useful because many of web interfaces are with sql server 2000 and we need to convert them into ASP.Net. Similarly I wanted to drag and drop couple of controls and less coding etc. and accomplish basic functionality of add/edit/delete records using remote database sql server 2000.
If possible please help me out.
Wondering is it possible to get the functionality of add/edit/delete records using datagrid/formview with remote sql server 2000, the way they explained in bigginers learning videos ... I am referring to (http://msdn2.microsoft.com/en-us/express/aa700802.aspx)
If possible and you think it is possible please guide me to that URL where I can learn the great functionalty n implement..!!
View 1 Replies
View Related
May 1, 2006
Hi,I need help. I transferred my database from one server to another byusing attach detach process.I created all the jobs which existed in theold server in the new server. Everything looked fine but a couple ofjobs is a giving me some problems. When I try to edit the job step Icould see that the database dropdown list doesn't contain the databasename(which I transferred from the old server)Does anyone have any idea about it.ThanksArun
View 1 Replies
View Related
Dec 26, 2007
I represent a software development house and we have developed a client server system based on SQL Server. Most of our customers have already purchased Enterprise License of SQL Server, therefore they own the SA Login and Password. We are bound to attach our Database with their Server on their machine.
My question is how can we stop a System Administrator of SQL Server to view our Database Structure, Queries, Data installed on their SQL Server on their machine.
Our database structure is a trade secret and we cant reveal the structure to the client.
please answer this question by email to me at farhandotcom@gmail.com
Thanks & Regards
Farhan
View 1 Replies
View Related
Apr 7, 2006
I found that when I install MSDE, then I can create/edit database objects for MSDE database in Visual Studio 2003 Server Explorer, but when I try to create/edit database objects under the default database created by the SQL Server 2000 installation, I cannot do these tasks as no option for these tasks appear when I right-click on the database object in Server Explorer. Anyone knows why this is happening?
View 3 Replies
View Related
Dec 7, 2006
Edski writes "Help please,
below is my sql query, when I run it, I get the right result with one problem. I get same customers with same email many times. I would only like the same customer shown one time. Checking it by email.
SELECT od.pName, od.dIndx AS dindx, od.pIndx AS pindx, od.device AS device, c.Cust_Id AS cust_id,
c.First_Name AS First_name,
c.Last_Name AS last_name, c.Email AS Email, c.Phone AS phone,c.company, h.productCode AS
product_code, DATEDIFF(dd, GETDATE(), h.expirationDate)
AS Difference, h.hotSyncId AS regcode, od.autorenewal AS autorenewal, od.installment AS
installment
FROM Orders_Detail od INNER JOIN
Hot_Sync_ID h ON od.dIndx = h.dIndx INNER JOIN
Customers c ON c.Cust_Id = h.cust_id
WHERE (od.prenewal ='False') and (od.autorenewal = 'no') and (c.newsletter <> 0) AND
(DATEDIFF(dd, GETDATE(), h.expirationDate) = '27') AND (c.company <> 'University of Alberta')
ORDER BY difference, c.Last_Name, h.productCode"
View 2 Replies
View Related
Nov 24, 2001
Hello,
I have some problems to edit a recordset in an ActiveX DTS using Vbscript.
Here is an example of the script :
dim varsql, varset, varconn
set varconn = CreateObject("ADODB.Connection")
set varset = CreateObject("ADODB.Recordset")
varconn.Open = "Provider=SQLOLEDB.1;Data Source=(local);Initial Catalog=Enregistrement3;user id = 'sa';password=''"
varsql = "SELECT * "
varsql = varsql & "FROM mytable "
varset.Open varsql, varconn, 3,3
msgbox "How much : " & varset.recordcount
if varset.recordcount >0 then
do while varset.eof
varset.edit
.........................
varset.update
varset.movenext
loop
end if
varset.close
varconn.close
Does someone see what is wrong ?
I allways get -1 for the varset.recordcount ! (I checked there are some records into the table).
I don't think it is a problem of user's right as it works with the same user configuration using a SQL action requery.
If I modify the open statement like this :
varset.Open varsql, varconn, 1
varset.recordcount contains the good number of records but the recordset is read noly and can't be modified...
Any Help will be very wellcome !
TIA
View 1 Replies
View Related
Aug 23, 2000
This is a basic, remedial question, but I've no experience whatsoever with SQL server or Access (although I'm familiar with basic DB concepts). Even so, I have inherited this project because no one else will take it (besides, I like the challenge of learning something new :-). If I understand correctly, I can use Access 2000 to create and edit DBs on my SQL 7 server, and to run queries. This is done by creating a WBEM ODBC connector (I have no idea how this is done). I'm pretty good at figuring things out on my own, but I sure would appreciate being pointed in the right direction. What I'd like to know is first of all, am I on the right track, and secondly, what do you all recommend as a good source of info on this topic (the Microsoft web site, technet, manuals?).
All info is greatly appreciated.
thanx,
-scott
View 3 Replies
View Related
Oct 25, 2005
Where do I go to modify the T-SQL statement I entered while creating a job with the web assistant wizard?
View 1 Replies
View Related
Jan 31, 2006
I need to convert this from Jet SqL to SQL Server. Moving out of an MDB to an ADP some of the queries I need to change over, I inherited this database and the bosses want all databases moved over from MDB to ADP.
SELECT Format$([Main Table].Date,'mmmm yyyy') AS [Date By Month], [Main Table].[Action Type], Count([Main Table].[Action Type]) AS [CountOfAction Type]
FROM [Main Table]
GROUP BY Format$([Main Table].Date,'mmmm yyyy'), [Main Table].[Action Type]
HAVING (((Format$([Main Table].[Date],'mmmm yyyy'))=[Enter the Month and the Year]));
View 1 Replies
View Related
Jul 23, 2005
How can i mark a row with its last edit time?With access it was obvious, in sqlserver?
View 1 Replies
View Related
Mar 18, 2008
Hi,
please, it is possible to know the edit distance used in the fuzzy lookup/grouping.
On this forum I read fuzzy lookup use 4-gram with fix size.
Does exist any document explaining how fuzzy lookup calculate the similarity? In other word, what kind of edit distance, algorithm is used by fuzzy lookup/grouping?
I hope I was enough clear with my poor english.
Thanks All
View 1 Replies
View Related
Sep 3, 2007
Two days back we have installed SP2 on SQLServer2005 Active/Active Cluster which result in failure.
Only Database Services and Analysis Services where not updated and rest of the services got updated.
After a restart , the behaviour of SQLServer is helarious.
We got into lot of problem so we opened support from Microsoft.
One of the problem i forgot to mentioed to Microsoft was on editing the Job i cannot see anything inside,all the entries where empty closing the job window and opening it again i got all my entries back but on editing i got the below mentioned Error.
Error:
Creating an instance of the COM component with CLSID {E80FE1DB-D1AA-4D6B-BA7E-040D424A925C} from the IClassFactory failed due to the following error:c001f011(Microsoft.SqlServer.ManagedDTS)
If anyone faced the same problem and got any resolution please let me know.
Anyhelp will be appriciated.
View 2 Replies
View Related
Aug 3, 2006
I have a many to many relationship I can design the table 2 ways:1) Category table (cat_id, cat_name, active) - cat_id as PKCategoryReq (cat_id, req_name) - cat_id & req_name as PK2)CategoryReq (req_name, cat_name) - req_name & cat_name as PKIf
I design 1st way. Then when they want to add and delete from the
CategoryRequest table, they would have to add to the category table
first. Then maybe build a list of checkboxes to select from. The one's
they check insert into the CategoryRequest table.Drawback of
this is that they can't edit the list on the fly. Since it may be used
by other request (since cat_id CategoryReq is fk into Category table)If I design it the 2nd way. Then they can edit, delete, add on the fly. But there won't be a master category list.Which way is better?
View 1 Replies
View Related
Apr 27, 2007
I have two questions:
1) Is it possible to rename a SQL table –or- copy the content of a table into a new table ?
2) How to replace the renamed or replaced table name inside the code of Stored Procedures that references it ?
View 2 Replies
View Related
Jan 9, 2004
Because of testing and deletion, my table of user groups starts at 15 or so. Now I want to insert a group for administrators but I would like to have the groupID be 1. I tried to turn off the identity seed property and insert it manually but that didn't work.
Is there any way to do this?
Thanks, Dave
View 3 Replies
View Related
Oct 23, 2004
I have a table with data in it. Now I want to change the Data Type from int to varchar. Is there anyway to do this because I don't want to delete all the data and re-enter it. That seems to be the only way I can see to change the data type. I would appreciate some help. thanks.
View 10 Replies
View Related
May 1, 2006
Hello
Am developing a web site using ASP.net 2.0. I have page to manage the employees information in term of viewing, inserting and updating. The problem is that the updating part doesn't work and it didn't give me any error messages.
My code is as following:
<%@ Page Language="VB" AutoEventWireup="false"%>
<!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>
</head>
<script runat="server" >
Protected Sub DetailsView1_ItemInserted(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DetailsViewInsertedEventArgs)
If (Not e.Exception Is Nothing) Then
ErrorMessageLabel.Text = "An error occured while entering this record. Please verify you have entered data in the correct format."
e.ExceptionHandled = True
End If
GridView1.DataBind()
End Sub
Protected Sub DetailsView1_ItemUpdated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DetailsViewUpdatedEventArgs)
GridView1.DataBind()
End Sub
Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)
DetailsView1.ChangeMode(DetailsViewMode.ReadOnly)
End Sub
Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)
DetailsView1.ChangeMode(DetailsViewMode.ReadOnly)
End Sub
Protected Sub GridView1_PageIndexChanged(ByVal sender As Object, ByVal e As EventArgs)
DetailsView1.ChangeMode(DetailsViewMode.ReadOnly)
End Sub
Protected Sub GridView1_Sorted(ByVal sender As Object, ByVal e As System.EventArgs)
DetailsView1.ChangeMode(DetailsViewMode.ReadOnly)
End Sub
</script>
<body dir="rtl">
<form id="form1" runat="server">
<br />
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:warehouse DBConnectionString2 %>"
ProviderName="<%$ ConnectionStrings:warehouse DBConnectionString2.ProviderName %>"
SelectCommand="SELECT DISTINCT [dep_Code], [dep_Name], [BRN_Code] FROM [Departments]"></asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:warehouse DBConnectionString2 %>"
ProviderName="<%$ ConnectionStrings:warehouse DBConnectionString2.ProviderName %>"
SelectCommand="SELECT DISTINCT [ID], [Name],[Position], [DEPT_Code] FROM [Employees]
where [DEPT_Code]=@dep_Name">
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList1" Name="dep_Name" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:warehouse DBConnectionString2 %>"
ProviderName="<%$ ConnectionStrings:warehouse DBConnectionString2.ProviderName %>"
SelectCommand="SELECT DISTINCT [ID], [Authentication], [Name], [Password], [Position], [DEPT_Code], [Contact] FROM [Employees]
where [ID]=@ID "
UpdateCommand="UPDATE [Employees]
SET
[ID] = @ID,
[Authentication]=@Authentication,
[Name]=@Name,
[Password]=@Password,
[Position]=@Position,
[DEPT_Code]=@DEPT_Code,
[Contact]=@Contact
WHERE [ID] = @ID "
InsertCommand="INSERT INTO [Employees]
([ID], [Authentication], [Name], [Password], [Position], [DEPT_Code], [Contact])
Values (@ID, @Authentication, @Name, @Password, @Position, @DEPT_Code, @Contact) "
>
<SelectParameters>
<asp:ControlParameter ControlID="GridView1" Name="ID" Type="Int32" PropertyName="SelectedValue" />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="ID" Type="Int32" />
<asp:Parameter Name="Authentication" Type="Int16" />
<asp:Parameter Name="Name" Type="String" />
<asp:Parameter Name="Password" Type="String" />
<asp:Parameter Name="Position" Type="String" />
<asp:Parameter Name="DEPT_Code" Type="Int32" />
<asp:Parameter Name="Contact" Type="String" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="ID" Type="Int32" />
<asp:Parameter Name="Authentication" Type="Int16" />
<asp:Parameter Name="Name" Type="String" />
<asp:Parameter Name="Password" Type="String" />
<asp:Parameter Name="Position" Type="String" />
<asp:Parameter Name="DEPT_Code" Type="Int32" />
<asp:Parameter Name="Contact" Type="String" />
</InsertParameters>
</asp:SqlDataSource>
<br />
<br />
أختر القسم :
<asp:DropDownList ID="DropDownList1" DataSourceID="SqlDataSource1" AutoPostBack="True"
DataTextField="dep_Name" runat="server" DataValueField="dep_Code" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged" >
<asp:ListItem></asp:ListItem>
</asp:DropDownList>
<table >
<tr>
<td style="width: 100px">
</td>
<td style="width: 100px">
</td>
</tr>
<tr>
<td style="width: 100px; height: 154px" valign="top">
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="ID"
DataSourceID="SqlDataSource2" AllowPaging="True" AllowSorting="True" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" OnPageIndexChanged="GridView1_PageIndexChanged">
<Columns>
<asp:BoundField DataField="ID" HeaderText="ID" ReadOnly="True" SortExpression="ID" />
<asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
<asp:BoundField DataField="Position" HeaderText="Position" SortExpression="Position" />
<asp:BoundField DataField="DEPT_Code" HeaderText="DEPT_Code" SortExpression="DEPT_Code" Visible="False" />
<asp:CommandField ShowSelectButton="True" />
</Columns>
</asp:GridView>
</td>
<td style="width: 100px; height: 154px" valign="top">
<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataKeyNames="ID" OnItemUpdated="DetailsView1_ItemUpdated"
DataSourceID="SqlDataSource3" Height="50px" Width="125px" AllowPaging="True" OnItemInserted="DetailsView1_ItemInserted">
<Fields>
<asp:BoundField DataField="ID" HeaderText="ID" ReadOnly="True" SortExpression="ID" />
<asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
<asp:BoundField DataField="Password" HeaderText="Password" SortExpression="Password" />
<asp:BoundField DataField="Position" HeaderText="Position" SortExpression="Position" />
<asp:BoundField DataField="Contact" HeaderText="Contact" SortExpression="Contact" />
<asp:TemplateField HeaderText="Department" SortExpression="DEPT_Code" >
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%#Eval("DEPT_Code") %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DropDownList2" runat="server" DataSourceID="SqlDataSource1"
DataTextField="dep_Name" DataValueField="dep_Code" SelectedValue='<%# Bind("DEPT_Code") %>'>
</asp:DropDownList>
</EditItemTemplate>
<InsertItemTemplate>
<asp:DropDownList ID="DropDownList3" runat="server" DataSourceID="SqlDataSource1"
DataTextField="dep_Name" DataValueField="dep_Code" SelectedValue='<%# Bind("DEPT_Code") %>'>
</asp:DropDownList>
</InsertItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Authentication" SortExpression="Authentication">
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%#Eval("Authentication") %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DropDownList4" runat="server" SelectedValue='<%# Bind("Authentication") %>'>
<asp:ListItem Text="Admin_User" Value="1" />
<asp:ListItem Text="Super_User" Value="2" />
<asp:ListItem Text="Normal_User" Value="3" />
</asp:DropDownList>
</EditItemTemplate>
<InsertItemTemplate>
<asp:DropDownList ID="DropDownList5" runat="server" SelectedValue='<%# Bind("Authentication") %>'>
<asp:ListItem Text="Admin_User" Value="1" />
<asp:ListItem Text="Super_User" Value="2" />
<asp:ListItem Text="Normal_User" Value="3" />
</asp:DropDownList>
</InsertItemTemplate>
</asp:TemplateField>
<asp:CommandField ShowInsertButton="True" />
<asp:CommandField ShowEditButton="True" />
</Fields>
</asp:DetailsView>
</td>
</tr>
</table>
<asp:Label ID="ErrorMessageLabel" EnableViewState="false" runat="server" />
</form>
</body>
</html>
View 4 Replies
View Related
Mar 11, 2002
HI,
I created a dts package using my Windows NT authentication. One of my colleague edited that package last week and when I tried to open it now, it gives me an error message "The system cannot find the file specified". The package still has my NT id as the owner. Could anyone please let me know why is this happening ???
My colleague is still able to edit my package. My NT id and my colleague NT id both are setup as administrators on the sql server. Any help is greatly appreciated.
Thanks
Ramesh
View 1 Replies
View Related
Aug 12, 1999
I'm working in Visual Basic 6 using SQL Server 6.5 connecting through a DSN (using ODBC)
I have a query "object.OpenRecordset("SELECT * FROM table", dbOpenDynamic, 0, dbOptimistic" returning a recordset. I loop through the recordset, edit a char field for each record and update it.
The first update works fine but the second update (and then on) fails returning an error message ODBC call failed and I also get an error S1106.
I ran the code in debugger mode and noticed that as soon as it updates the first record, the pointer seems to move to the next record before even doing the "MoveNext" (based on the field contents), but the AbsolutePosition remains fixed until MoveNext is executed. At that point, if I do a "MovePrevious", the record is not there anymore and has totally
disappeared from the recordset. What is happening and how do I get around that????
View 1 Replies
View Related
Jul 21, 1999
I read on this forum that it is possible to move a device by:
Update the sysdevices table to point to the new location (ex: D:SQLTESTDB.DAT)
Stop the SQL Server
Physically move the file to the new location
Restart the SQL Server.
How can I update sysdevices table?
View 1 Replies
View Related
Mar 31, 1999
We are using MS Access as a front end to a SQL Server 6.5
Database using ODBC & linking tables in Access.
We are unable to edit certain records using access. We
get the following error message:
"This record has been changed by another user since you started
editing it. If you save the record, you will overwrite the changes
the other user made.
Copying the changes to the clipboard will let you look at the values
the other user entered, and then paste your changes back in if you
decide to make changes."
What the message says is untrue in our case. Worse, there is
no way to recover and have the desired change posted. This error
occurs only with certain records. This error occurs when there are
no locks active (and only 1 client logged in).
I am inclined to think that this error may be the fault of ODBC.
Updating the same change directly into ISQL works fine. SQL Server Permissions
have beeen checked & double checked.
If you have suggestions as to how this error can be rectified, please contact
me:
Mark Blackburn
mark@mbari.org
http://www.mbari.org/~mark
View 3 Replies
View Related