I have two SQL Express database and I want to do two things. One is to transfer a table over to the other database. Two, move the files from one table in one database to another. Please let me know when you get a chance.
I have VC++ express and MSSQL SMS express and have an application working nicely locally. The Data explorer and data connections part works really easily.
Now, I want to make the application available to my home network.
I mapped the drive where the database is and called it Z: so I could put my "release" on my other network PC and assumed it would find Z: if I mapped the shared network drive on that machine and called it Z:
But: I can't even add the mapped connection on the local machine, I get:
The file "Z:databasescalorie.mdf" is on a network path not supported for database files. An attempt to attach.....etc"
It works fine on the original F drive.......
Am I approaching this the wrong way. How should I distribute to network PCs?
anyone knows if there's an easy way to insert new GUIDs into uniqueidentifier cells when editing data in table on Management Studio Express? or Visual Studio 2005 Server Explorer? I can't find a shortcut, and copying from external tools is pain..
I suppose it's possible to build a VB macro in Visual Studio, would it work when editing table data?
David writes "Dear sir, I've installed VS.NET 2005 Professional many times and find that the MS SQL Express 2005 is running. My ambition is to log into this server so that I can convert my MySQL database into it. What is the default; Hostname Port Username Password
What tool is provided so that I might execute my schema to create a database in this server. This 'schema' will obviously have many tables inside. Most SQL products provide some type of utility program where one can create, edit, delete databases and an adminstration program. I see nothing of yours in my Programs -> MS SQL Server 2005 -> SQL Computer Manager. Thank you, David Kennedy"
How do you determine the data folder during the SQL2005 Express install? No matter what folder I start with it gets appended with MSSQL.1 or MSSQL.2 If another vendor has installed a different instance of SQL2005 how do I know whether mine is .1 or .2 ?
Basically I need to know the full folder in order to copy our MDF/LDF files into so we can attach them.
I created a link from Oracle to SQL server. There is a trigger with insert statment in Oracle side. I got error message as follow when trigger is invoked:
SQL> insert into test1 values ('zerbra','brazi'); insert into test1 values ('zerbra','brazi') * ERROR at line 1: ORA-02047: cannot join the distributed transaction in progress ORA-06512: at "GGWEB.TRIGGER2", line 4 ORA-04088: error during execution of trigger 'GGWEB.TRIGGER2'
my simple trigger is as follows: create or replace TRIGGER TESTRI AFTER INSERT ON TEST1 FOR EACH ROW BEGIN insert into test1@sqlserver (city,state) values ('what','nine');
Hello there,Now I'm really down, how do I simply create a Table in a database?It must be something likeCreate Table TableName ( column_name data_type ) But first how do I execute that string, so it create the table..And if we get that far, how do you then set a table to primarykey? Hope really for help, because this is a importen thing, and I cant find the answer? :S
I have a database that is in mssql and I'm using an odbc link to an access database where I want to add records to the mssql table. When I open the linked table in access it does not allow me to add a record. I have created a user account in mssql that has ownership to the database and I use this user in setting up the odbc link.
I am new to ms SQL. I only have the use of the Enterprise Manager. Creating tables I understand. However I am confused on how to add data to a table or view the data in a table. Can this be done through Enterprise Manager? If I am adding a large amount of data do I have to use the query window. This seems like a tedious method. In Access yo have a form basically pop up where you can type in the record sets. Any advice would be appreciated! Sincerely, Bill Bequette
Ben writes "I have a sql script that doesn't function very well when it's executed on a SQL 2000 server.
The scrpt looks like this:
--------------------------------------------------------------------------------------------------- USE [master] GO IF NOT EXISTS (SELECT * FROM master.dbo.syslogins WHERE loginname = N'SSDBUSERNAME') EXEC sp_addlogin N'SSDBUSERNAME', N'SSDBPASSWORD' GO GRANT ADMINISTER BULK OPERATIONS TO [SSDBUSERNAME] GO GRANT AUTHENTICATE SERVER TO [SSDBUSERNAME] GO GRANT CONNECT SQL TO [SSDBUSERNAME] GO GRANT CONTROL SERVER TO [SSDBUSERNAME] GO GRANT CREATE ANY DATABASE TO [SSDBUSERNAME] GO USE [master] GO If EXISTS (Select * FROM master.dbo.syslogins WHERE loginname = N'SSDBUSERNAME') ALTER LOGIN [SSDBUSERNAME] WITH PASSWORD=N'SSDBPASSWORD' GO GRANT ADMINISTER BULK OPERATIONS TO [SSDBUSERNAME] GO GRANT AUTHENTICATE SERVER TO [SSDBUSERNAME] GO GRANT CONNECT SQL TO [SSDBUSERNAME] GO GRANT CONTROL SERVER TO [SSDBUSERNAME] GO GRANT CREATE ANY DATABASE TO [SSDBUSERNAME] GO USE [master] GO IF EXISTS (select * from dbo.sysdatabases where name = 'ISIZ') DROP DATABASE [ISIZ] GO USE [SurveyData] GO exec sp_adduser 'SSDBUSERNAME' GRANT INSERT, UPDATE, SELECT, DELETE TO SSDBUSERNAME GO USE [SurveyManagement] GO exec sp_adduser 'SSDBUSERNAME' GRANT INSERT, UPDATE, SELECT, DELETE TO SSDBUSERNAME ---------------------------------------------------------------
I need to be converted to a script that can be executed on both MSSQL 2000 and MSSQL 2005.
I was wondering if somebody there could help me with this problem?!
I am a starter of vb.net and trying to build a web application. Do anyone know how to create a temp table to store data from database? I need to extract data from 3 different tables (Profile,Family,Quali). Therefore, i need to use 3 different queries to extract from the 3 tables and then store it in the temp table. Then, i need to output the data from temp table to the screen. Do anyone can help me?
i was planning to create a database migration tool .. its a certain database of a DMS (document management system) to another DMS (two different DMS)... from DMS using msde 2000 server .. and tranfer to a DMS using a postgre sql or mssql .. depends ..
they have different table structures and names . . :D
i was thing of what language shall i use.. or what language is the best to work on this kind of project :)
I have an InfoPath form that submits data to a .NET webservice. The webservice parses the infopath form and inserts the data into a database. The database is SQL Server EXPRESS.
I have however run into some problems. The InfoPath form is within SharePoint and I noticed that when I submit the data, it only shows up in the database as a new record 9 out of 10 times. That is for every 10 submissions of the form, there are only about 9 new records in the database. The ID field (an autoincrement field) also skips a number indicating the the transaction may have failed.
However, when I test the form on my local PC, it inserts a new record for every submission.
The webservice and database are on a remote server not my local.
Does anyone have any ideas? Could it be a deficiency of SQL Server Express?
Any ideas, answers or suggestions would be much appreciated.
I've been doing a lot of research lately to determine the most secure way to issue an insert statement to insert my data into my SQL database. I'm coding this following using Visual Basic: Protected Sub submitButton_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim strConn As String = "server=.SQLEXPRESS;database=C:SJ-siteSJApp_DataSJDb.mdf; User Id=user; password=password" Dim MyQuery As String = "Insert into sjTable (PostID, Category, TitleofPost, Description, Price, Loc, ContactInfo, DatePosted, Disclaimer) Values (@Category, @TitleofPost, @Description, @Price, @Loc, @ContactInfo, @DatePosted)" Dim MyConn As New Data.SqlClient.SqlConnection(strConn) Dim cmd As New Data.SqlClient.SqlCommand(MyQuery, MyConn) Dim curDate As String On Error Resume Next
MyConn.Open() If Err.Number <> 0 Then MsgBox("There was an error connecting to the database.", MsgBoxStyle.OkOnly) Err.Number = 0 End If
curDate = Now() With cmd.Parameters .Add(New System.Data.SqlClient.SqlParameter("@Category", categoryDropDown.Text)) .Add(New System.Data.SqlClient.SqlParameter("@TiteofPost", titleTextbox.Text)) .Add(New System.Data.SqlClient.SqlParameter("@Description", descriptionTextbox.Text)) .Add(New System.Data.SqlClient.SqlParameter("@Price", priceTextbox.Text)) .Add(New System.Data.SqlClient.SqlParameter("@Loc", locationTextbox.Text)) .Add(New System.Data.SqlClient.SqlParameter("@ContactInfo", contactTextbox.Text)) .Add(New System.Data.SqlClient.SqlParameter("@DatePosted", curDate)) End With If Err.Number <> 0 Then MsgBox("There was an error inserting the data into the database.", MsgBoxStyle.OkOnly) Err.Number = 0 End If
MyConn.Close() If Err.Number <> 0 Then MsgBox("There was an erro closing the database connection.", MsgBoxStyle.OkOnly) Err.Number = 0 End If Server.Transfer("submitted.aspx")
End Sub The code gives no errors, it directs me straight to the submitted.aspx page but when I query the database it is not inserting any data into my database. .My Error log shows the following:2006-06-27 12:14:16.68 spid51 Starting up database 'C:SJ-SITESJAPP_DATASJDB.MDF'.2006-06-27 12:14:26.93 Logon Error: 17828, Severity: 20, State: 3.2006-06-27 12:14:26.93 Logon The prelogin packet used to open the connection is structurally invalid; the connection has been closed. Please contact the vendor of the client library. [CLIENT: <local machine>]I am able to log into the database using my account via SQL Server Management Studio Express. I've been all over the forums and google looking for a solution but everything I've been trying to mock up from other people's code hasn't helped. Thanks in advance for your assistance
Hello, im shure this must have been up before and i apologize for that. But i wonder if there is a way to convert the SQL server express databases to MSSQL 2005 databses?
DB is developed on local computer with MSSQL 2005 Express. My host is on MSSQL 2005 workgroup. Are they compatible, because I am getting errors? Is my approach wrong?
I have tried several approaches.
A) I created a backup of database on my local, then placed a copy on the server. Then I tried to restore through Server Management Studio. I get this error.
TITLE: Microsoft SQL Server Management Studio
------------------------------
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
ADDITIONAL INFORMATION:
The backed-up database has on-disk structure version 611. The server supports version 539 and cannot restore or upgrade this database.
RESTORE FILELIST is terminating abnormally. (Microsoft SQL Server, Error: 3169)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=08.00.2039&EvtSrc=MSSQLServer&EvtID=3169&LinkId=20476
------------------------------
BUTTONS:
OK
------------------------------
B: I also have tried copying the database. I put it in the same path as the other databases that can be read with server management studio on the server. Then, tried to get to it through server managements studio and it did not appear. So I tried to attach it. Then I received this error:
TITLE: Microsoft SQL Server Management Studio
------------------------------
Attach database failed for Server 'MROACH1'. (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.2047.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476
------------------------------
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
Could not find row in sysindexes for database ID 10, object ID 1, index ID 1. Run DBCC CHECKTABLE on sysindexes.
Could not open new database 'LodgingDB'. CREATE DATABASE is aborted. (Microsoft SQL Server, Error: 602)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=602&LinkId=20476
------------------------------
BUTTONS:
OK
------------------------------
C: I have also tried opening the Database, and back up file through Server Management Studio. without success.
D: I also tried Windows and Software update at microsoft update, but no updates were recommended for Version on Server.
I'm surprised this is so hard. My original data base was created in same family of software. 2005 MS SQL Express. I could use some direct help from someone experienced with this. Am I doing it wrong or are the DB versions incompatible.
I'm completely new to ASP.NET. I want to insert data to the SQL SERVER EXPRESS database.When the button clicks i want to add the details into database.This is the coding i did with online help. Can you help me to do a good coding ad some error showing on my 7th line("connection.Open()").. And can you advise me to do correct coding for how is get data from database and display it on web page. Thanks in advance.And here is the coding i did to Insert data, Imports System.Data.SqlClient Partial Class _Default Inherits System.Web.UI.Page Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Dim connection As New SqlConnection(" database=share") Dim cmd As New SqlCommand("INSERT INTO sdetails (cid, cname, date, qty, pps)VALUES('" & txtcid.Text & "','" & txtcname.Text & "','" & txtdate.Text & "','" & txtqty.Text & "','" & txtpps.Text & "')", connection)
I'm new to asp.net and I have gotten quite far with books and such but I'm stuck at this point. I have a web form that is mostly populated with data pulled from AD and all the user does is make a selection in two drop lists and enter their initials to sign. I can't figure out how to insert a record into a table when buttin pressed. I verified that all the data types are correct so it shoud pass the info but its just not going anywhere. I've atached the code below. Thanks,protected void accept_btn_Click(object sender, EventArgs e) { string adPath = LDAP://DC=********,DC=***; //Path to your LDAP directory servermembers adAuth = new members(adPath); string username = Context.User.Identity.Name; string computer_name = System.Environment.MachineName;string comp_type = comptype.SelectedValue.ToString(); string install_type = installtype.SelectedValue.ToString();string date = DateTime.Now.ToString(); string email = adAuth.getemail(Context.User.Identity.Name);string agree = initials_txtbox.Text;string title = "Office"; test_lbl.Text = (username + " " + computer_name + " " + comp_type + " " + install_type + " " + date + " " + email + " " + agree + " " + title);
I'm trying to learn some VB programming with the VB 2005 Express Absolute Beginner Series video tutorials (which I think is great) and have come across a problem that I can't solve.
When I follow the instructions in Lesson 9 (Databinding Data to User Interface Controls) my application will display the data from the database correctly and I can edit it (and as long as the debugger is running the data remains changed). However, the changes won't propagate back to the database. I don't get any error messages but after I edit the data, save (with the save button on the BindingNavigator toolbar), and end debugging the data in my database remains unchanged. When I use a MessageBox to show how many rows where edited/updated in the
I get the correct number back. I'm sure the problem is not due to coding errors since I've also tried running the accompanying Lesson 9 project file that can be downloaded from MSDN and the problem persists.
I'm using Windows XP SP2, SQL Server 2005 Express Edition and VB 2005 Express Edition. I've tried installing SQL Server 2005 Express with a number of different settings, including default settings, but it doesn't make any difference.
Would greatly appreciate any feedback on this as I'm keen to resolve this problem so I can get on with the next tutorial lesson.
What is wrong with this code the dropdowlist mainlyusing System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using System.Data.SqlClient;public partial class NewAccount : System.Web.UI.Page{ protected void Page_Load(object sender, EventArgs e) { } protected void NaccountButton_Click(object sender, EventArgs e) { if (Page.IsValid) { //Define data objects SqlConnection conn; SqlCommand comm; //read from web config string connectionString = ConfigurationManager.ConnectionStrings["OneBank"].ConnectionString; //Initialize connection conn = new SqlConnection(connectionString); //create command comm =new SqlCommand( "INSERT INTO Customer (FirstName, LastName, Street, City, State," + "Zip, Phone, Payee,AccountType)" + "VALUES(FirstName, LastName, Street, City," + "State, Zip, Phone, Payee,AccountType)", conn); //add parameters comm.Parameters.Add("@FirstName", System.Data.SqlDbType.NVarChar, 50); comm.Parameters["@FirstName"].Value=Firstname.Text; comm.Parameters.Add("@LastName", System.Data.SqlDbType.NVarChar, 50); comm.Parameters["@LastName"].Value=lastname.Text; comm.Parameters.Add("@Street", System.Data.SqlDbType.NVarChar, 50); comm.Parameters["@Street"].Value=street.Text; comm.Parameters.Add("@City", System.Data.SqlDbType.NVarChar, 50); comm.Parameters["@City"].Value=city.Text; comm.Parameters.Add("@State", System.Data.SqlDbType.NVarChar, 50); comm.Parameters["@State"].Value=state.Text; comm.Parameters.Add("@Phone", System.Data.SqlDbType.Int); comm.Parameters["@Phone"].Value=phone.Text; comm.Parameters.Add("@AccountType", System.Data.SqlDbType.NVarChar, 50); comm.Parameters["AccountType"].Value = dropdownlist1.SelectedValue.ToString(); //Enclose database in try catc finally try { //open connection conn.Open(); //execute the command comm.ExecuteNonQuery(); //reload query Response.Redirect("NewAccount.aspx"); } catch { //Display error Errormessage.Text= "Error submitting request!"; } finally { conn.Close(); } } }}
This is the table where thisis going customer ------------- customerID pk generated automatically firtsname lastname street city statezipphoneaccountType
I have a table changereport and network info.i insert a record with date of insertion plus chagereport id.then I have a xml file <ChangeReport> <Network-Info> <Version> 2.0</Version> <Highest-Ver> 2.0</Highest-Ver> <Description> WinSock 2.0</Description> <System-Status> Running</System-Status> <Max> 2.0</Max> <IP-address> 192.168.142.1</IP-address> <Domain-Name> samin</Domain-Name> <UDP-Max> 2.0</UDP-Max> <Computer-Name> SAMIN</Computer-Name> <User-Name> samin</User-Name> </Network-Info></ChangeReport> I want's to insert a record in network info table where field name are nodes name data should be the one against those nodes in xml file .How can I do it I am using sql server
What have I done wrong with this script?I'm getting an error 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.
hi It seems that my code can insert data into memory, but not into the database. What I mean is that after "insert data", I can "read data", which I just insert. When I check the actual database table, it didn't get updated.
I am using VS 2005 and table designer. Regarding to this problem, is it related to any setting of setup of the database? I check the code, and I have no idea how it occurs.
Hi,I have app with file selection field. Users can shoose xml file from their local hard disk and click Save. When they click save, content of xml file should be inserted into mssql 2000.What is the most efficient way to do this using C#2005 and mssql2000?Any good article or tutorial?
Hello Everybody,In my web application I have to insert html from editor. I have assigned the filed as "nvarchar". But after running the insert query it throws an error "A potentially dangerous Request.Form value was detected from the client (oEdit1="<P><SPAN style="FONT..."). " I'm using WYSWYG editor. I'm now quite bit confused about the the field and the query. If you have any idea about the problem please help me out of this problem.Thanks in option.Regards--Arindam
HelloCan anyone help me translate this from access so that it can work in mssql(i need to get next value, but cannot use identity as if row is deleted,another must get new next column number which would be same as deleted one)Access;INSERT INTO tableSELECT(IIF(code<>Null,MAX(code)+1,1) AS code,0 AS usercodeFROM tableI tried this in mssql but will not work:INSERT INTO tableSELECTCASEWHEN code IS NULL THEN 1ELSE MAX(code)+1ENDAS code,0 AS usercodeFROM table
Ok what i am looking to do i cannot figure out. What i want to do is have a simple script that when a user logs onto the website (via windows auth) to get there username somehow llike with Request.ServerVariables("LOGON_USER") that should display there username either "domain/name" or "username" and then insert that into the UserLogs Table under my database with the date with the GETDATE() command.. But when i do this i cannot get the page to auto submit the values. Actually i cannot get anything to write to the DB unless i am doing it under the query builder. Here is my Query that i was using. INSERT INTO UserLogs([User], Date) VALUES (@UserName, GETDATE()) then in the Code of the page i have <%@ Page Language="VB" AutoEventWireup="false" CodeFile="SubmitForm.aspx.vb" Inherits="Template_SubmitForm" %><!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> <body><% Dim name name = Request.ServerVariables("LOGON_USER")%> <form id="form1" runat="server"> <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:REPCOMConnectionString %>" InsertCommand="INSERT INTO UserLogs([User], Date) VALUES (@name, GETDATE())" SelectCommand="SELECT [User], Date FROM UserLogs" CancelSelectOnNullParameter="False"> <InsertParameters> <asp:SessionParameter DefaultValue="test1234" Name="name" SessionField="name" /> </InsertParameters> </asp:SqlDataSource> </form> </body> </html>