|
|
hi
I want to connect to a sqlserver instance on another computer in the workgroup network.
my program is win application with c# VS.NET 2008 and SQL Server 2000.
what settings are needed for my sqlserver instance and my application?
can you help me?
H.R
|
|
|
|
|
You need to create a Login on the sql server, apply permissions to it (Server roles, User Mapping, etc) and then in your application create a connection string for that server, e.g.
string ConnectionStr = "data source=FriendsServerName;initial catalog=TheDataBase;User ID=YourLogin;Password=12345";
Using that connection string connect to your friend's sql server.
That should do the trick.
It does on SQL Server 2005 anyway.
var question = (_2b || !(_2b));
|
|
|
|
|
thanks, I did them but I could not to connect.
----------------------------------
my application: VS.NET 2008-C#
my DB: SQL Server 2000 Personal Edition
my OS: Win XP Profesional sp3
----------------------------------
I have done these steps:
1. in target sql server instance: Enterprise Manager -> server -> right click -> Properties -> Connections tab -> tick:
-allow other sql servers to connect remotely to this sql server using RPC
-enforce distributed transactions
2. in target sql server instance: Enterprise Manager -> server -> right click -> Properties -> General tab -> Network Configuration... button ->
enabling TCP/IP
3. in target sql server instance: Enterprise Manager -> server -> right click -> Properties -> Security tab -> Authentication ->
SQL Server and Windows
4. I created a New Login in target sql server instance:
Name=admin , Password=1001 , SQL Server Authentication , Database=Exam
5. my SqlConnection in application:
"Server=192.168.0.205\\MYSQLSRV; Initial Catalog=Exam; Integrated Security=False; Persist Security Info=False; User ID=admin;Password=1001";
6. I removed anti virus softwares and turned off Windows Firewall.
7. I tested both of my computers to ping to another
But yet I have an error:
an error was occured while establishing a connection to the server. when connecting to sql server 2005, this failure may be caused by the fact under the default settings sql server dose not allow remote connections.
(provider:sql network interfaces, error:26-error locating server/instance specified)
----------------------------------
can any one help me ?
H.R
|
|
|
|
|
Erm, it seems fine, except:
H.R wrote: 5. my SqlConnection in application:
"Server=192.168.0.205\\MYSQLSRV; Initial Catalog=Exam; Integrated Security=False; Persist Security Info=False; User ID=admin;Password=1001";
Well, that should be your connection string, not the actual connection, as in:
private void ConnectToDb()
{
SqlConnection sqlConn = new SqlConnection("Server=192.168.0.205\\MYSQLSRV; Initial Catalog=Exam; Integrated Security=False; Persist Security Info=False; User ID=admin;Password=1001");
sqlConn.Open();
sqlConn.Close();
}
Test it like that.
If this is how you used it, though, I honestly do not know what is wrong.
One more thing... i understand you added a login to the server instance... but DID you actually add a user to the database you want them to use?
You'll find a "Users" folder in Databases/YourDb/Security/Users
That should help. I think.
var question = (_2b || !(_2b));
|
|
|
|
|
Hi
I am making a .NET program (C#) and are using a Tab Control with 3 tabs...however, when I hover the tabs I get a flickering effect. Anyone know how to fix this? is this a bug with the control?
|
|
|
|
|
Be sure that you have double buffering for the form set to true.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
Setting doublebuffered on the form did not have any effect. However, the following code did clear up this and other repaint issues easily:
protected override System.Windows.Forms.CreateParams CreateParams
{
get
{
var cp = base.CreateParams;
cp.ExStyle |= 0x2000000;
return cp;
}
}
I find it really strange that this isn't enabled by default from Microsoft since the TabControl looks like crap without it, and there are no apparent downside of using the fix above except that you get a bit more memory usage and a few more lines of code.
Please, if possible, enlighten min why Microsoft decided to drop this option as on by default? For the record; it sets the WS_EX_COMPOSITED Window property. In MSDNAA I can't find any information indicating why this is not enabled.
|
|
|
|
|
Hi,
I have a problem backtracing which .Net transaction is blocking another transaction.
I would like to find which .NET transaction is blocking another .NET transaction. I can find the locks in SQL Server 2008 and it's corresponding SQL Server transactionids, but I cannot map the .NET transactionids to them.
In the sys-tables of SQL Server 2008, I find the transactionids of the blocking transaction and the transaction that is being blocked. (eg 75288) When I retrieve the transactionid from within my .net application through 'System.Transactions.Transaction.Current.TransactionInformation.LocalIdentifier.ToString()', it's a guid. I expected the transactionid of sql server and .Net transactionid to be the same, so I could backtrace to the blocking transaction in .NET and resolve the locking problem.
Can anyone help me with this? Thanx.
Kind regards,
Webster
|
|
|
|
|
Well, for one, a .NET transaction from System.Transactions is not specifically a database transaction. Its a .NET transaction, which may involve many resource managers, including SQL Server, but not limited to it. Its entirely possible to have a .NET transaction that doesn't involve SQL Server at all. So there is unlikely to be any correlation between the transaction ID for the .NET transaction and the transaction ID for the SQL Server transaction, I wouldn't try to use any comparison between the two to find a match.
As for a solution to your problem...you probably need to use a profiler that will trace your calls and identify blocks. I am not sure if either of these will take you directly to the source of the problem, but they are both pretty advanced and should help:
JetBrains dotTrace Profiler
RedGate Ants Profiler
|
|
|
|
|
Can any one suggest me how to connect the database using vb.net 2008.
|
|
|
|
|
e.g.,
string connstring = "Data Source = .\\ABC;Initial Catalog = XYZ; Integrated Security = True";
SqlConnection conn = new SqlConnection(connstring);
SqlCommand comm = new SqlCommand();
comm.CommandText = "Select * From DummyTable";
comm.Connection = conn;
conn.Open();
comm.ExecuteScalar();
conn.Close();
MSDN[^]
|
|
|
|
|
There is not just one or two ways to do this. I highly suggest picking up a book on ADO.NET to have as a learning tool and reference.
|
|
|
|
|
I am new to development. Could anyone suggest,what are the different downloads I would have to do,to start learning c# on the .NET framework?
|
|
|
|
|
If you have .net, you have all you need. The framework includes CSC, the command-line compiler for C#.
I suggest you open a DOS box, write a "hello world" console app, and compile it.
|
|
|
|
|
|
|
thanks..Seems like the exact tutorial i was looking for.
|
|
|
|
|
Do you have developed experience
i just do it
|
|
|
|
|
Guys, we are all developers here --most at least--
I found out about this great little companion for developers and non-developers: http://tinypad.info/[^]
It's really slick and very light. I got so used to it, I can't turn it off.
Another great yet simple idea! Made with .NET 3.5
Just thought I might share this with you all!
|
|
|
|
|
I far prefer OrangeNote[^] made by one of the CP regulars. I use this tool regularly.
|
|
|
|
|
yeah that's another great, two separate concepts though.
Tiny Pad is much lighter on the system. I really like the archiving feature. The highlighting and the firefox-like search are real key features.
What's a real bummer is that there's no tagging like OrangeNote.
I heard the next version will work on Unix/Mac.
Thanks for sharing!
|
|
|
|
|
Hello
I am new in .NET frame work.Actually i have done a project in Symbian os.
How i have to access a calender database from pc by using visual stdio frame work.
Can any one help me as soon as possible.
Jobayer
|
|
|
|
|
when i tried to open the inetmgr it is showing the following error
ntvdm cpu has encountered an illegal instruction in iis
|
|
|
|
|