|
Mycroft Holmes wrote: As we are no longer encouraged to beat them with the sarcasm stick Sigh , I see no reason not to scream it in their face.
Even though neither method has the desired effect in too many cases
|
|
|
|
|
hi everyone,
I have a tab control with 3 tabs, A,B,C.
I have one one database "student" in which i have 4 columns.
There are two datagridviewB and datagridviewC in the two tabs B and C.
I am updating the entries of a datagridviewB by entering details in a form present in Tab A.
Now when I am working in tab C to update the datagridviewC, say for example filtering "student" database and displaying filtered results in datagridviewC; while updating datagridviewC, I noticed that datagridviewB in tab B also getting updated.
My code for filter "student" database in tab C is like this:
cmd = New SqlCommand("SELECT * FROM student WHERE [Name] <= '" + name + "'", con)
myDA = New SqlDataAdapter(cmd)
myDataSet = New DataSet()
myDA.Fill(myDataSet, "student")
datagridviewC.DataSource = myDataSet.Tables("student").DefaultView
Can someone tell me, how to update the datagridviewC in tab C without altering the entries present in datagridviewB in tab B?
FYI : my datagridviewB contains all the student data and in tab C i am filtering the database based on "Name" and displaying in datagridviewC.
|
|
|
|
|
If your datasource for the datagridviews is the same then naturally the data is the same. You can separate the datasources into bindingsources or copy the dataview to a new table for each datagridview.
BTW this should be in the Windows Forms forum.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi guys.
I'm using LINQ to modify a database.
I want to take a back up from the database.
Could you please guide me , how I can do it with LINQ ?
|
|
|
|
|
You don't need Linq to backup a database. What is it that you want to accomplish?
only two letters away from being an asset
|
|
|
|
|
I've created a SQL database beside my exe file, I'm trying to take backup from it through my application.
At first , I've used File.Copy , but I receive this Exception cannot access because it is being used by another process
Could you guide me, how I can do it ?
|
|
|
|
|
Mohammad Dayyan wrote: cannot access because it is being used by another process
Perhaps your application? If the app uses a mdf file as a resource then it is possibly loading the file at start up. That should give you a start of where to look.
only two letters away from being an asset
|
|
|
|
|
Run normal backup code from your application, rather than to use File.Copy. File.Copy needs the mdf files to be detached from your server instance which is not good technique.
BACKUP DATABASE [DbName] TO DISK = N'C:\dbName.bak' WITH NOFORMAT, NOINIT, NAME = N'DbName-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
Just change the dbName, disk location for your backup and Name of the Backup file and run this using command.ExecuteNonQuery() .
And believe me... you dont require LINQ for doing this .
|
|
|
|
|
Thanks Abhishek Sur.
I'm using LINQ, so I've used the following code :
public static void GetBackUp()
{
if (!Directory.Exists(StaticVariables.BackUPFolder))
Directory.CreateDirectory(StaticVariables.BackUPFolder);
using (RezaRestaurant.SQL.DataClasses1DataContext dbc = new RezaRestaurant.SQL.DataClasses1DataContext())
{
dbc.ExecuteCommand(@"BACKUP DATABASE " + dbc.Mapping.DatabaseName + " TO DISK='c:\aaa.bak'");
}
}
and this Exception has occurred :
http://www.codeguru.com/forum/attachment.php?attachmentid=25454&d=1253973435[^]
|
|
|
|
|
I have a project to convert a database from Postgresql to SQL Server. I know of tools to convert the database from one to the other but all I have are scripts right now. Does anyone know of a utility that can take scripts created for Postgresql and create a SQL Server database from them?
only two letters away from being an asset
|
|
|
|
|
Depending on the size of the database it would almost be worth installing postgre just to use the conversion tools. I'm assuming they have an express type product.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
There is no express version but I already have Postgresql installed. The problem in the scripts I've been provided with won't run. I wanted to try converting them to TSQL and running them against SQL Server directly since the ultimate goal is to port it to SQL Server anyway.
only two letters away from being an asset
|
|
|
|
|
Sounds like a hand job to me That my double entendre for today....
I'd try splitting the scripts to types ie tables, procs and views, see if there are any standard conversions and try running them individually. Sounds like a LOT of work even if there are no constraints and key involved. I'd go back to the client and try and get a backup.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Mycroft Holmes wrote: I'd go back to the client and try and get a backup.
Trying. Unfortunately, I've taken over this project after the original team's failure. They are uncooperative to the point of potential legal actions by the client. I had the suspicion that it would a tedious manual process but had ask just in case.
only two letters away from being an asset
|
|
|
|
|
As others have said, this is going to be a tedious manual process.
I work with Ingres and SQLServer on almost a daily basis; Ingres isn't PostreSQL, but I'm assuming it isn't too far off either.
If you have the scripts to create tables, etc, can you write a script to extract the table name, columns, datatypes and null settings? Having these, you should then be able to script the tables creation in SQLServer.
I will help as I can.
Tim
|
|
|
|
|
I want to Synchronize two Database in two server in sql server 2008. Database Mirroring is not working for me... I've created Master key, Certificate, endpoints... Everything is perfect.. But, even though, the Mirroring is not working.. Is there any other way to attain synchronization... Plz, Anybody Could help me???
|
|
|
|
|
I have a sql server 2008 database installed on windows server 2008, I enabled remote access to it and enabled TCP/IP and added rules for the TCP/IP port on the firewall exceptions and I restarted all sql server services.
I try to connect to the database from my pc remotely using the sa account but it fails.
I even created a new user account and tried to connect using this account but also fails.
What am I missing?
Do I have to download sql server 2008 on my pc to connect to the database remotely instead of sql server 2005?
can someone help me out?
|
|
|
|
|
What is the Error that you Receive ?
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Nada Adel wrote: Do I have to download sql server 2008 on my pc to connect to the database remotely instead of sql server 2005?
I believe that you do. Given that it should not take too long, depending on the speed of your connection, I would try that. The reason I say that is because I have 2005 and 2008, on two different PCs and 2005 will not connect to a copied 2008 database.
However, as Vuyiswa Maseko asked, do you get an error message? The answer to that might help to pin down the problem.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: TCP Provider, error: 0 -
|
|
|
|
|
also this error was displayed too at some point!!
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provi
|
|
|
|
|
I have seen a lot of people all over the web with this same problem so I will let you know how I fixed my problem with it and maybe it will help someone!
Firstly, go into IIS Manager and click on your website or directory.. on the right hand panel there is a connection strings option - dbl click on it and it will tell you what your default local sql server is set to.. somehow mine got all screwed up so that was part of my problem.. hopefully that is ALL of your problem (some of you anyhow)..
For me it was more complex however.. I was also trying to do personalization for anonymous users.
Thus, in my web.config there were two sets of connection strings..
one was labelled thus:
<appSettings>
<add key="ConnectionString" value="server=localhost;database=caleb.mdb;uid=;password=;" />
</appSettings>
..so I thought I was using MS Access.. but there was another Connection String attribute like this..
Somewhere else I found this kind of connection string..
<connectionStrings>
<add name="LocalhostCTP6" connectionString="Data Source=localhost;Initial Catalog=CTP6;User ID=dnn;Password=dnn" providerName="System.Data.SqlClient" />
<add name="DynamicConnection" connectionString="Data Source=localhost;Initial Catalog=CTP6;User ID=dnn;Password=dnn" />
</connectionStrings>
<appSettings>
<add key="ConnectionInfo" value="server=(local);database=Northwind;Integrated Security=SSPI" />
</appSettings>
(see this article[^]
If you arent sure which connection string is actually being used by your program, you can use this code..
[^]
..and to complicate things more, an external file can be involved too as it was in my case!!
<appSettings file="testlabsettings.config"/>
and as if things werent already complicated enough it is possible to add connection strings on the fly at run time see
http://www.kodyaz.com/articles/add-connection-string-to-web-configuration-file.aspx[^]
(luckily for me, noone was doing this as far as I know!!)
So there you have it guys.. if that doesnt solve your problem I will eat my hat!
|
|
|
|
|
I've just installed sql server 2008 but still not working.
I have a feeling that the server name is not correct. Can you tell me how to write the server name??
I have access to the server and the database on the server. When I access the database locally I write for example ("MyServer,portnumber")
but remotely, I can't seem to access it using the same server name.
|
|
|
|
|
You might try visiting ConnectionStrings.com[^], a very useful site.
I know that you are not using a connection string but the site shows many variations on the machinename/servername combination.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I've tried everything. Still cannot connect. I used the IP address of the server but still can't connect.
Is there anything I can do on the server to enable remote connection..I've done everything I can thing of..am I missing something?
|
|
|
|