|
I added a connection using the tab above the toolbox tab to an Access database. But how do I actually add the connection to the form (or whatever else you do for Visual Studio 2005) to use it and create datasets and data adapters?
Thanks
|
|
|
|
|
I am using Visual C# 2005 Express Edition and there is a tab 'Database Explorer'. I right click on the Database Connections and choose Add Connection from the menu. From there, the wizard walks me through connecting to an Access database. I hope this sheds some light for you.
Paul
-- modified
As far as after connection is in place, you need to tie to a dataset, and data adapter. The data adapter connected to the connection and data set get filled by the data adapter.
|
|
|
|
|
Would like someone to assist me with sample codes used to open a file(a Picture in particular) from a drive in the computer so as to display it on an access form.
Thanks in advance.
ffffffffffffffffffff
|
|
|
|
|
Hello all,
Seeing as how I'm not exactly a SQL whiz, I periodically use built in templates to create tables, views, etc. in SQL code. Microsoft's latest iteration of SQL Server (2005) includes a large number of templates. Some of these templates are very unhelpful at best.
For instance, I'm trying to create a constraint between two tables. If I open up Microsoft's handy-dandy template, the code it spits out first tries to DROP the table that the constraint will be on (if the table exists). Obviously, this is not even a halfway useful solution.
I managed to retrieve the code for altering a table and adding a foreign key constraint, but I can't determine if the constraint exists to drop it. Does anyone have any ideas about this one?
Thanks,
Will
|
|
|
|
|
Hello everybody,
I have a little (for me big ) problem.
I try to insert Data into Access with a DataTable, but everytime it throws an error when I update
System.Data.OleDb.OleDbException was unhandled
Message="Syntaxfehler in der INSERT INTO-Anweisung."
Source="Microsoft JET Database Engine"
ErrorCode=-2147217900
StackTrace:
at System.Data.Common.DbDataAdapter.UpdatedRowStatusErrors(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount)
at System.Data.Common.DbDataAdapter.UpdatedRowStatus(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount)
.....
[CSHARP]
public void InsertArtikelToInventur(string ean, long Menge, string lagerplatz, long Nr_Filiale)
{
string l_krit;
string sql = "";
l_krit = "Artikelnummer=\"" + ean + "\"";
object l_ret = dlookup("Nr", "Artikel", l_krit);
if (l_ret != null)
{
sql = "SELECT INVENTURSTAND.Nr_Artikel, INVENTURSTAND.Datum, INVENTURSTAND.Menge, INVENTURSTAND.aktuell, INVENTURSTAND.Alter, INVENTURSTAND.Nr, INVENTURSTAND.Lager, INVENTURSTAND.Lagerplatz, INVENTURSTAND.Nr_Adresse_Lager FROM INVENTURSTAND";
OleDbCommand myOleDbCommand = new OleDbCommand(sql, connection);
OleDbDataAdapter myOleDbDataAdapter = new OleDbDataAdapter(myOleDbCommand);
DataTable dt = new DataTable();
OleDbCommandBuilder myOleCB = new OleDbCommandBuilder(myOleDbDataAdapter);
// myOleDbDataAdapter.InsertCommand = myOleCB.GetInsertCommand();
myOleDbDataAdapter.Fill(dt);
DataRow dr = dt.NewRow();
dr["Nr_Artikel"] = (int)l_ret;
dr["Datum"] = DateTime.Now;
dr["Menge"] = Menge;
dt.Rows.Add(dr);
myOleDbDataAdapter.Update(dt);
}
}
[/CSHARP]
|
|
|
|
|
hello!
Perhaps you can try with a DataSet object...
VentoEngine corp.
Program your life ^^
|
|
|
|
|
hi ,
when i am trying to connect to a sql server database i'm getting this error:
The user instance login flag is not supported on this version of SQL Server. The connection will be closed.
Do anybody know the reason?
thanks
|
|
|
|
|
Hi there,
Which SQL's version you are using? is it 2005?
<< >>
|
|
|
|
|
|
Hi there,
Are you creating database from code? if so, it's not supported on full version of SQL 2k5, only for SQL Express.
So, you have to create manually database in SQL 2005 and set the connection point to it
<< >>
|
|
|
|
|
can you please give me an example?
|
|
|
|
|
How can I download the Reporting services?
Pooja
|
|
|
|
|
Now before anyone sends me links to any articles here on CP or else where on master/detail solutions i've already looked at them and none of them show me what i want to do.
I have a very simple database with two tables one holds a collection of jobs with basic field info for each plus a ClientID field to link each job to a specific Client.
the client table has all the detailed info about each client in the table it's primary key obviously being ClientID;
now my program consists of:
a DataGrid showing all jobs scheduled for the current day (i always use stored procedures this one pulls everything based on records matching a date i submit)
a bunch of textbox controls one for each column in the Client table.
now all the master detail articles i have read would list all the clients in one table and clicking on one would update the details table with all the jobs for that client.
what I want to do is when a user clicks on a specific job in the datatable the textboxes will be updated to reflect the correct Client's details for that specific job.
my stored procedure to get a specific clients details uses the current rows clientID of the job table.
now the first job i select and the textboxes work. when i select any other jobs the text boxes never change.
what am i doing wrong and could anyone point me in the right direction.
thanks
Ryan
-- modified at 2:20 Friday 25th November, 2005
|
|
|
|
|
I have a book which shows an example of using the osql command but when I try it, I get a message that the SQL Server does not exist or access is denied.
The command I am entering is:
osql -E
Can anyone tell me how to grant access or find another way around this?
|
|
|
|
|
Is your server set up for windows authentication or sql server authentication? If the latter, -E will fail. This will also fail if the server is not running...
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke
|
|
|
|
|
The options are either both windows auth AND sql server auth at the same time, or only windows auth. So osql -E should be available always. If it doesnt work, it might be that you're logged on to Windows using an account that has not been granted access to MS SQL Server.
|
|
|
|
|
When I installed the MSDE version of SQL Server, I did so with Windows authorisation.
If I need to grant my account access to the SQL Server, could you tell me how to do this?
When my computer starts, the Server is showing as running, and so I don't think this is the problem.
|
|
|
|
|
In Enterprise Manager: Expand the server your trying to access, then expand the Security node and click on the Logins node under Security. Here you can create a new login with Windows Authentication.
-a
|
|
|
|
|
happy thanksgiving to all in the US,
So here's the deal. I'm writing a large system with a lot of different components. I've decided to use C++ as the 'mian' programing language so that for critical time dependant operations I can switch to native code easily. My question is, is ADO.NET "fast" enough for critical datasource operations, or would it be wiser to switch to native code for all datasource operations? The system is HIGHLY database intensive and so I would want to gain as much time as possible.
Thanks,
John
|
|
|
|
|
The only real way for you to answer that is to measure.
However, remember that the round-trip time involved in a database call is non-trivial - much the same as any other cross-process call on the same machine (if your database is on the same machine) and subject to network latency as well (if on another machine). Therefore you should try to do as much in each database call as possible. In the distributed computing arena this is often called making your interface 'chunky' rather than 'chatty'.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
I am running mySQL 4x on a FReeBSD dedicated. I am trying to figure out how to install mySQL 5 NOT IN PLACE OF mysql 4. I want to be able to run both versions for testing reasons before I remove the older installation.
The standard pkg_add returns an error regarding a conflict with the older version of mysql.
|
|
|
|
|
Hi,
I am concatenating 2 fields, wine name and wine vintage:
SELECT Wne_Name + ' ' + Wne_Vintage...
Some wines have a vintage of 0, not sure why. How do I do an if statement in the SELECT statement, I want all 0 values to be replaced by "N/A":
Amani Vineyards Merlot 2002
Amani Vineyards Merlot N/A
Wne_Vintage is of type int.
I hope someone can help.
Regards,
ma se
|
|
|
|
|
case when Wne_Vintage = '0' then 'N/A'
else Wne_Vintage end
"People who never make mistakes, never do anything."
My Blog
|
|
|
|
|
This assumes Wne_Vintage is a character field. If it is an interger remember to cast it to a char.
|
|
|
|
|
Hi,
Thanks for the replies!!
This is what I have and I am getting an error. Not sure how to reseolve it.
SELECT Wne_ID, Wnr_Name + ' ' + Wne_Name + ' ' +
CASE
WHEN Wne_Vintage = '0' THEN 'N/A'
ELSE CONVERT(varchar, Wne_Vintage)
END
FROM cyb_tblWineries, cyb_tblWines
WHERE cyb_tblWines.Wne_Wnr_ID = cyb_tblWineries.Wnr_ID
AND Wne_Show = 'y'
ORDER BY Wnr_Name, Wne_Name;
The error is:
<b>Implicit conversion of varchar value to varchar cannot be performed because the collation of the value is unresolved due to a collation conflict.</b>
Wne_Vintage is an int.
Regards
|
|
|
|