|
hi
i have a problem that is cause of my amfusing
i cannot login to my sql database account from query analyzer.
but my site work correctly.
the error is:
unable to connect to ??????? server:
error: msg 11,level 16,state 1
general network error,check your documentation network.
please help me
nobody help you...
you have to help you yourself
and this is success way.
|
|
|
|
|
hi
its Either your password is wrong , or you are Connecting to a wrong Server, that has no User that you want to Exit, remember that the useer does not roam, if you have create a user for a certain server , it will not work in other servers, i suggest you try to create a new user with the same name as the one you are saying, you have, if it says it exists, them the user does not exists in that server.
Hope it helps
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Hello,
I am new to ADO and have to learn it for work so im playing aroud with it...my problem is that I have a blank datagrid on my form. I am trying to make a connection to an oracle database and create an SQL statement to retrieve the data I want and then display this in my datagrid...this is my code:
Dim dsWorkGroup As New DataSet 'New data set
'New connection string and variable to hold connection string ( i am sending the actual user name and password in the string)
Dim connectionString As String = "Data Source=PIDBDEV;User ID=######; Password=######;Unicode=True"
Dim connection1 As New OracleClient.OracleConnection(connectionString)
'Sql statement to retrieve the fields to fill the dataset
Dim selectStatement As String = "SELECT Group_Name FROM BASE_CALC_CODES"
Dim selectCommand As New OracleClient.OracleCommand(selectStatement, connection1)
Dim daWorkGroup As New OracleClient.OracleDataAdapter(selectCommand)
daWorkGroup.Fill(dsWorkGroup)
also I do have a datasourse attached to the datagrd. What am I doing wrong??? It isnt displaying the results from the query...it displays the entire table.
Erica
|
|
|
|
|
hi Erica
i have never connected to an Oracle DB, but now, you did not bind the datagrid to your dataset.
after the last line in your code, put the following line
Datagrid1.DataMember = "BASE_CALC_CODES"
Datagrid1.DataSource = dsWorkGroup
.
and i have an article, that has something like this, it might help you understand some of this and dont forget to vote.
http://www.codeproject.com/useritems/N-Tier_Application_VB.asp[^]
Hope it helps
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Hello All,
First, I did try to search for the answer to this one and I either didn't use the correct keywords or something because the system didn't return any hits; so here I am.
Simply, I know there is a way to insert the same data into 2 different tables but I need to do it within 2 different databases. I am using a stored procedure but I am not sure how to set it up in the procedure. I know I need to enclose it in a transaction but how do I direct the insert to populate the second table in the other database?
Any assistance would be greatly enjoyed.
Fred
|
|
|
|
|
Are your two databases on the same server? If so, you can reference tables in the other database using the syntax database.owner.mytable .
If the two databases are on different servers, you can set up one of the servers as a linked server in your other server.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Paul,
Thanks for the quick response. I gave it a try on some test tables I created and executed the SP and had a return value of '0' which is good. The only problem is that the information I tried to insert was not in either table
Below is what I created, could you take a look and see if I am missing something.
-- Insert statements for procedure here
BEGIN TRANSACTION
INSERT INTO ff_test(TestInput, TestInputCode)
VALUES('INSERTED','1')
IF @@ERROR <> 0 BEGIN
ROLLBACK TRANSACTION
RETURN 2
END
INSERT INTO [FEDEX].[dbo].ff_test(TestInput, TestInputCode)
VALUES('INSERTED','1')
IF @@ERROR <> 0 BEGIN
ROLLBACK TRANSACTION
RETURN 3
END
COMMIT TRANSACTION
RETURN 0
|
|
|
|
|
Your code looks OK, so I'm not sure what the problem is. I would try running the SQL Profiler to determine which statements in your stored procedure are actually being executed.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Not sure what was going on there but the information is now in the tables, and representative of each time I tried to execute the program. Weird but now ok. I will futz around some more to clean it up but again "THANKS" for the pointer. It works.
F
|
|
|
|
|
I would like to import my HOST file into a DB Table and the periodically run a script to verify if all the entries are the same, changed, deleted, etc.
|
|
|
|
|
solutionsville wrote: I would like to import my HOST file into a DB Table and the periodically run a script to verify if all the entries are the same, changed, deleted, etc.
Good for you.
Did you have a question that you wanted to ask?
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hello Paul.
I guess I was kinda vauge... Mind is elsewhere. Funeral today.
I want to write an SQL script that looks at the Windows HOSTS File and reads the IP / host name into two columns of a table.
I next want to write a SQL Script that I can run as a job and validate the entries in the hosts file and if they have changed then modify the table data.
I will also send a diff email to myself noting any changes(the email piece I have figured out).
Thanks,
|
|
|
|
|
solutionsville wrote: I guess I was kinda vauge... Mind is elsewhere. Funeral today.
Sorry to hear that.
solutionsville wrote: I want to write an SQL script that looks at the Windows HOSTS File and reads the IP / host name into two columns of a table.
You could write a small .NET program to read the contents of your HOSTS file into SQL Server. Use the System.IO.File.ReadAllLines() to load the contents of the file into an array. Then do some string manipulation to separate the IP address and host name for each entry. Then use ADO.NET to load the data into your database.
solutionsville wrote: I next want to write a SQL Script that I can run as a job and validate the entries in the hosts file and if they have changed then modify the table data.
You could achieve this by using SQL Server AGent to set up a job that runs periodically.
solutionsville wrote: I will also send a diff email to myself noting any changes(the email piece I have figured out).
You can write code in T-SQL to send mail. Have a look at this article[^]. You could invoke this from your SQL Server Agent job.
Hope this helps.
-- modified at 10:12 Tuesday 27th November, 2007
I forgot to include the link to the email article. I've put it in now.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
|
I need to update a field in a record in a table how can I access it to change it.
ie: i have a grid view and a form view on the same page I want to put the highest value in the grid view in a field in the formview and save it to the data base.
Thank you
BiG RaLpH
|
|
|
|
|
How can i insert breakpoints in stored procedures(SQL SERVER 2000) using SQL Debugger in Query Analyzer.
Exec sp_sdidebug 'legacy_on' is not working.
Thanx in advance
|
|
|
|
|
|
yes to some extent but i m not using windows or any other application.i just want to debug my sp from query analyzer.The problem is that Step Into button is disabled in my T-SQL Debugger
|
|
|
|
|
Hi ,
I can restore my db from SQL server Management with this script;
RESTORE DATABASE [LIDER] FROM DISK = N'E:\OyunTakip\database\LIDER.BAK' WITH FILE = 1, NOUNLOAD, REPLACE, STATS = 10
GO
but i cant do the same thing from C#.
SqlConnection baglantim = new SqlConnection("data source=THORN\\SQLEXPRESS; database=LIDER; integrated security=SSPI");
baglantim.Open();
string cmdText = "RESTORE DATABASE" + " LIDER" + " FROM DISK = 'E:\\OyunTakip\\database\\LIDER.BAK'" + " WITH MOVE 'LIDER' TO 'e:\\Oyuntakip\\database\\LIDER.mdf' " + ",MOVE 'LIDER_Log' TO 'E:\\Oyuntakip\\database\\LIDER_log.ldf'" + ",REPLACE";
SqlCommand komut = new SqlCommand(cmdText,baglantim);
komut.ExecuteNonQuery();
Getting this error ;
RESTORE cannot process database 'LIDER' because it is in use by this session. It is recommended that the master database be used when performing this operation.
RESTORE DATABASE is terminating abnormally.
i cant solve it help pleasEEEe ;(
|
|
|
|
|
tr_thorn wrote: SqlConnection baglantim = new SqlConnection("data source=THORN\\SQLEXPRESS; database=LIDER; integrated security=SSPI");
Change it to
SqlConnection baglantim = new SqlConnection("data source=THORN\\SQLEXPRESS; database=Master; integrated security=SSPI");
That should work.
SG
Cause is effect concealed. Effect is cause revealed.
|
|
|
|
|
Getting this error after change LIDER to Master ;
Exclusive access could not be obtained because the database is in use.
RESTORE DATABASE is terminating abnormally.
|
|
|
|
|
Surely you restore into a new database. If the database already exists the restore process cannot work. Try restoring to a database name that does not already exist on the server.
|
|
|
|
|
Execute this command after setting the connection and before restoring the DB
ALTER DATABASE LIDER SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
Of course, the ramifications being that any user connected to the DB will lost connection and any open transactions will be rolled back. It's pertinent for you to check if there are any existing users first, any running transactions first and then do the recovery.
SG
Cause is effect concealed. Effect is cause revealed.
|
|
|
|
|
how can i restore database to exists database.?
|
|
|
|
|
tr_thorn wrote: how can i restore database to exists database.?
Using these[^] command
SG
Cause is effect concealed. Effect is cause revealed.
|
|
|
|