|
If you are using .Net, the the GetOledbSchemaTable method of the database connection:
static DataTable GetSchemaTable(string connectionString)
{
using (OleDbConnection connection = new
OleDbConnection(connectionString))
{
connection.Open();
DataTable schemaTable = connection.GetOleDbSchemaTable(
OleDbSchemaGuid.Tables,
new object[] { null, null, null, "TABLE" });
return schemaTable;
}
}
If not, then see the ADOMD documentation, it provides a similar function.
|
|
|
|
|
how to create a database in connection base
santhosh
|
|
|
|
|
Can you rephrase that in English please
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
Ed.Poore wrote: Can you rephrase that in English please
Thanks for the new sig material, Ed
Paul
That's no moon, it's a space station. - Obi-wan Kenobi
|
|
|
|
|
I should start charging you for these sigs , feels like I've got an amiable stalker
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
Ed.Poore wrote: I should start charging you for these sigs
How have things been? Pop any critters lately with your air gun?
Christian Graus wrote: So your belief is based on the last thing you read online ? That's really sad...
|
|
|
|
|
|
Ed.Poore wrote: A few
Ed.Poore wrote: typical western shot where the body went tumbling backwards
I've taken a few pop shots at ground squirrels lately, but more ocean fishing than anything else
That's no moon, it's a space station. - Obi-wan Kenobi
|
|
|
|
|
SqlConnection conn = new SqlConnection("Server=bla;Initial catalog=bla;User Id=bla;Password=bla");<br />
OleDbConnection conn2 = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\bla.mdb");
Simple, check the documentation of the .NET framework for more samples
WM.
What about weapons of mass-construction?
|
|
|
|
|
Hi Friends,
While I am trying to connect to the database server I am getting the following error.
ERROR: 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
I checked my web.config file. I didnt find any errors in this.
Please help me to solve this.
I am using VS 2005 and SQL Server 2000
Thank you
Jijo
JIJO BABY - Lets Play C#
|
|
|
|
|
How are you connecting, SQL based Authentication? (I.e. username and password), if so then SQL by default does not have this enabled, you'll need to open up the MMC snap-in for SQL and enable it. If the SQL Admin doesn't know how to do this then... Google
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
Hi,
I'm trying to change the name of a column in an Access 2000 database (using C#). From my internet research, It looks like there is no sql RENAME for Access. I have come up with the code below, but please let me know if there is better sql code for this.
"ALTER TABLE Products ADD COLUMN NewColumn DECIMAL"
"UPDATE Products SET NewColumn = OldColumn"
thanks,
Ron
|
|
|
|
|
hi there i have this pro too.. i have a set of database in access format and i wish to change the name of my columns..how can i do it? do i need to change e codes written in visual studio?
|
|
|
|
|
Access SQL does not support renaming a columm with DDL See this for more info.[^]
The steps you mentioned are the only option using sql statements (you might want to add "Alter Table Products DROP COLUMN OldColumn;") after the Update statement.
|
|
|
|
|
|
I'm pretty sure you could do it using ADOX[^]
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
I attempting to install MSDE on my PC (windows XP) and I get the following error:
Event Type: Information
Event Source: MSSQLSERVER
Event Category: (2)
Event ID: 17055
Date: 8/3/2006
Time: 10:40:23 PM
User: N/A
Computer: MyComputerName
Description:
The description for Event ID ( 17055 ) in Source ( MSSQLSERVER ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: 19013, SQL server listening on Shared
I found this Article online and tried everything but to no avail. Any suggestions on how to fix this will be greatly appreciated.
-- modified at 3:34 Friday 4th August, 2006
Greg
Coding makes the world go round!!!
|
|
|
|
|
SQL Server 2005 Express is out now, it's a better choice than MSDE if you can make the choice. It has much better capabilities as well.
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
Will this be ok with ASP.net 2003? Also, which would be better MSDE or SQL server Management Studio Express since the express has EM?
Greg
Coding makes the world go round!!!
|
|
|
|
|
Skanless wrote: Will this be ok with ASP.net 2003?
Should be since it can act as a "standard" SQL Server, however you'll probably only leverage the new features using .NET 2
Skanless wrote: which would be better MSDE or SQL server Management Studio Express
All I know is that I tried installing MSDE once and gave up, installer experience was dreadful, tools were almost non-existant etc etc. SQL Server 2005 & SSME are great tools. They're only missing a few features from the full blown edition, apart from maybe some tools such as in-depth performance analysis and all the "boring" stuff that admins need concern themselves with I think that the only major difference between Express & Non-Express is the database size limitations. Express can only handle up to 3GB (I think).
I've been doing a big project for a local company and I started the database development on my laptop acting as the server since they hadn't received their copy of SQL yet, when it arrived and was installed the admin simply hooked my database files in and all I had to do was change the authentication and server names in my project and it ran happily (we'll that side of it anyway ).
Basically in the short and long term I would have said SQL2005 is a better bet, much better environment than the one I came across with MSDE (even I could set up the database and permissions etc and I hate and have done very very little "large" database development).
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
That isn't really an error, although for some reason it seems as though the message table (which contains the format strings for event log entries) wasn't registered properly. Anyway, it's actually an Information class event, and the log message simply means that the SQL Server service is started and is listening for connections using the Shared Memory scheme. You should be able to connect to it on the local machine. To connect to it over the network, you will need to enable at least one network protocol.
|
|
|
|
|
Thanks for all your help guys. I restarted and before I know it..........Walla.........my MSSQL server was up and running. I am really glad to a part of this forum and really grateful for you guys. Thanks.
Greg
Coding makes the world go round!!!
|
|
|
|
|
hi all i have this pro on hand now.. i have downloaded some sample database applications from the internet..however when i want to debug it i gives me the error--An unhandled exception of type "system.Data.OleDb.OledbException" occurred in system.data.dll
does this errors occur due to where the dB file is located..is it correct? can someone out there help will this pro? and maybe guide me to correcting it ..thanks in advance..
an extract on of codes where the problem is highlighted is below:the pro is bold...thanks in advance
private void fclsMain_Load(object sender, System.EventArgs e)
{
m_cnADONewConnection.ConnectionString =
@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\temp\contacts.mdb";
m_daDataAdapter =
new OleDbDataAdapter("Select * From Contacts",m_cnADONewConnection);
OleDbCommandBuilder m_cbCommandBuilder = new OleDbCommandBuilder(m_daDataAdapter);
m_daDataAdapter.Fill(m_dtContacts);
this.ShowCurrentRecord();
one of the ans i got is entering cnADONewConnection.Open();
before m_daDataAdapter.Fill(m_dtContacts);
but i got an error like this C:\Documents and Settings\STUDENT\Desktop\Database Example\Form1.cs(235): The type or namespace name 'cnADONewConnection' could not be found (are you missing a using directive or an assembly reference?)
can anyone please give me more detailed help as im really new to this
|
|
|
|
|
skyeddie wrote: The type or namespace name 'cnADONewConnection' could not be found
Basically the variable / type / class "cnADONewConnection" cannot be found. I'm guessing (based on the snippets you provided), that you'll need to find the line which this error was thrown on (the debugger will break on that line) and rename 'cnADONewConnection' to 'm_cnADONewConnection'.
Try that, I can't provide more information because there aren't enough details (if you have exceptions throw can you please in future provide the majority of the text because it will help much more, i.e. just saying an exception of type 'OleDbException' was thrown, provide the error message, although it may not look like much it will help us help you.
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
I'm just starting to familiarise myself with ADO etc, however I am reasonably familiar with relational databases on non-windows platforms.
I started by creating a SQL database, defining a couple of simple tables and a foriegn key relationship between the two. I dragged the two tables onto the DataSet design surface, and pleased to see the relationship was also manifested.
The problem I have is no matter how hard I try, I just can't get changes (inserts, deletes or updates) made to the DataSet tables to persist in the actual database tables. I've focused on insertions -so far I've tried 1) using table.Rows.Add(row); 2) using adapter.Insert(col1Value, col2Value etc) and 3) invoking a stored procedure directly with a SQLCommand.ExecNonQuery. I can see the rows in the DataSet table, they get pulled into listboxes, datagrids etc. But the values never seem to get to the database itself.
If I put rows into a table directly (from the DataSources window) then they persist in the d/b itself and my code will get them with an adapter.Fill - hence I'm pretty sure that the connection string is OK. Before executing an AcceptChanges (at table or dataset level) HasChanges returns true, HasErrors returns false and the RowStates are as expected, AND after the AcceptChanges HasChanges and HasErrors are false and all the RowStates are Unchanged.
The impression I have is that the database is "readonly", and writes are being ignored and exceptions are not raised.
I'm using VS C# Express and SQLExpress -
Any assist will be truly assisted
|
|
|
|