|
Firstly hi to all,
I want to learn is there anyone or anyplace that has all countries' icon flags in jpg or gif files.
I mean for example: for United States US.jpg for United Kingdom UK.jpg for Turkey TR.jpg.
I want like this since I've collected these countries in short forms to SQL and I want to call these images by /folder/(user.Country)"+".jpg"
Is there any better way to do this?
Any help will be appriciated
Arda
-
When in doubt, push a pawn!
-
|
|
|
|
|
I have a simple datagrid that i want to add a combo box to on e of the columns but can't find any information on how. Any help will be a start.
Chris
|
|
|
|
|
hi,
Firstly if you are using VS.NET right click the datagrid and select Edit Template and then click Item Template. Datagrid's apperance will change and then drag and drop the box(es) to the Item Template(the very first row). Finally right click the datagrid again and then select End Template Editing.
If you want further information and some simple dynamic codes for selecting a row here is the link that I know http://www.dotnetbips.com/displayarticle.aspx?id=147
Kind Regards,
-
When in doubt, push a pawn!
-
|
|
|
|
|
I do not see the "edit template" functionality. This is a datagrid in a window form, does that matter?
|
|
|
|
|
oh absolutely in windows applications it changes but I don't know about them.
Hope you can find a solution.
Kromozom
-
When in doubt, push a pawn!
-
|
|
|
|
|
I'm using asp.net, c#, and Sql Server. I'm calling a sp, and I'm getting an error back. I have the "ExecuteNonQuery" wrapped in a try/catch. I fall into my catch, but what is the best way to find out which column I'm getting a unique constraint error on?
I'm checking SqlException from my catch, and I notice that the SqlException.Number==2627. I also look in the SqlException.Message, and it has some good text in it.
The sp is inserting into a couple of tables, which each have a unique constraint on them.
Do I need to parse the SqlException.Message? Is there a cleaner way?
Thanks in advance,
|
|
|
|
|
when i search using ado's seek method on a multi- column index if the data entered matches partially the method returns true
example: an access table with an index consisting of first and lastname when i use the ADO seek method it finds a record even if i only eneter a firstname that exist and leave the last name blank
|
|
|
|
|
This is a wierd one!
I'm trying to use a transaction, when I try to execute the command I get the following error:-
The transaction assigned to this command must be the most nested pending local transaction
I've looked on the web and MSDN and can't find a reference to this error! Anyone got any ideas?
Dim myTrans As OleDbTransaction = conn.BeginTransaction(IsolationLevel.ReadCommitted)<br />
Command.Transaction = myTrans<br />
'Try<br />
myTrans.Begin()<br />
If UniqueID > 0 Then<br />
'it exists so update it<br />
Command.CommandText = "UPDATE PCLEquipment SET NoOff=NoOff+1 WHERE UniqueID=" & UniqueID<br />
Command.ExecuteNonQuery() 'FAILS HERE<br />
Else<br />
'it doesn't so add it<br />
Command.CommandText = "INSERT INTO PCLEquipment(PlayerID,EquipmentID,NoOff) VALUES(" & PlayerID & "," & ItemID & ",1)"<br />
Command.ExecuteNonQuery() 'FAILS HERE<br />
End If<br />
'subtract cost<br />
SpendMoney(Command, Money, PlayerID)<br />
myTrans.Commit()
|
|
|
|
|
Hi Lee
You have already started a transaction by calling the "conn.BeginTransaction " method - try removing the call to "myTrans.Begin " (which is used to created nested transactions).
Hope this helps.
Andy
|
|
|
|
|
Durr! <slaps himself="" on="" forehead="">
Thanks Andy
|
|
|
|
|
Hi,
our website is presently using Access as it's database. We are planning to redesign our website and we'd like to improve our database system. So I have a few questions:
1) What version should we use? 97, 2000 or 2002? Why?
2) Should we use Jet drivers or Access drivers (DRIVER={Microsoft Access Driver (*.mdb)}; )? I guess that questions 1 and 2 are related...
3) Is there a proper way to open and close a connection? For example, should I open a connection at the beginning of a page, let the recordsets found in the code use the same connection, and close that connection at the end of the page, when I'm done with it? Or should I use may different connections (like 1 connection for each recordset)?
Any other info/links are welcomed!
Thanks!
---------------
Tired of Spam? InboxShield 2.0.2 for Microsoft® Outlook® 2K/2K2/2K3
http://www.inboxshield.com
|
|
|
|
|
LukeV wrote:
What version should we use? 97, 2000 or 2002? Why?
Any version will do !
LukeV wrote:
Should we use Jet drivers or Access drivers (DRIVER={Microsoft Access Driver (*.mdb)}; )? I guess that questions 1 and 2 are related...
I've had the best results with the OLEDB (Jet) Driver
LukeV wrote:
Is there a proper way to open and close a connection? For example, should I open a connection at the beginning of a page, let the recordsets found in the code use the same connection, and close that connection at the end of the page, when I'm done with it? Or should I use may different connections (like 1 connection for each recordset)?
Use the same ADODB Connection, and just close it at the end of code execution
HTH
Tony
|
|
|
|
|
LukeV wrote:
What version should we use? 97, 2000 or 2002? Why?
2000 is good .. 97 is good too !!!
LukeV wrote:
Should we use Jet drivers or Access drivers (DRIVER={Microsoft Access Driver (*.mdb)}; )? I guess that questions 1 and 2 are related...
never use that one I had troubles with it
use jet 4.0
|
|
|
|
|
Have you considered migrating ot MSDE? Essentially the server engine from SQLServer 2K - should have it available on either the Office CD, or Visual Studio stuff - if you have that available, then even get the wazzy front end tools....think it's called the MSDE For Visual Studio o something similar
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
I have an issue with the use of parameters when attempting to talk to the database.
// This piece of code returns exactly what I expect
OleDbConnection myConnection = new OleDbConnection(ConnectString);
myConnection.Open();
OleDbCommand myCommand = myConnection.CreateCommand();
myCommand.CommandText = "SELECT statement FROM sys_sql " +
"WHERE key = 'clsDBNotesSelect'";
string strResult = (string) myCommand.ExecuteScalar();
myConnection.Close();
// This piece of code results in "An unhandled exception of
// type 'System.Data.OleDb.OleDbException' occurred in system.data.dll"
OleDbConnection myConnection = new OleDbConnection(ConnectString);
myConnection.Open();
OleDbCommand myCommand = myConnection.CreateCommand();
myCommand.CommandText = "SELECT statement FROM sys_sql " +
"WHERE key = @KEY";
myCommand.Parameters.Add("@KEY", OleDbType.VarChar, 50);
myCommand.Parameters["@KEY"].Value = "clsDBNotesSelect";
string strResult = (string) myCommand.ExecuteScalar();
myConnection.Close();
I've tried several variations and methods. None will get me past the error. Any input is appreciated.
Dan
|
|
|
|
|
Hi Dan
The "@Key" syntax for parameters is required by the SQL-Server provider. For the OLEDB provider (that you seem to be using), you need to use question marks in the query text:
OleDbConnection myConnection = new OleDbConnection(ConnectString);<br />
myConnection.Open();<br />
OleDbCommand myCommand = myConnection.CreateCommand();<br />
myCommand.CommandText = "SELECT statement FROM sys_sql " +<br />
"WHERE key = ?";<br />
myCommand.Parameters.Add("@KEY", OleDbType.VarChar, 50);<br />
myCommand.Parameters["@KEY"].Value = "clsDBNotesSelect";<br />
string strResult = (string) myCommand.ExecuteScalar();<br />
myConnection.Close();
Note that I have not tested the above code.
Hope this helps.
Andy Harman
|
|
|
|
|
Thank you very much. All the references I have always talk about the Sql provider and I've had to stumble through several different oddities due to the OleDb provider.
Your solution does work but I've lost the uniqueness of the parameters. I tried to replace the @ with the ? (leaving KEY) but it didn't like that. What is the methodology used if the CommandText changes (which it will!) to something like:
"SELECT statement FROM sys_sql WHERE key = ? AND owner = ?"
Is it going to be based on the order of the parameters added? Therefore, the first one added belongs to "key = ?" and the second to "owner = ?"?
Thanks
Dan
|
|
|
|
|
OleDb does not support named parameters.
Yes you have to add them in order.
The first param will be the first ?
and so on.
Bo Hunter
<marquee behavior="alternate">Bo Hunter
|
|
|
|
|
You could always build the string with String::Format and then pass (or initiate) it to an instance of OleDBCommand object...
OleDBCommand cmd = new OldDBCommand(String::Format("Select * from database where var1 = {0} and var2 = {1}",System::Object, System::Object ) ); //check the overrides for Format for your particular instance...
not 100% sure on the syntax but it's close enough for you to get the idea... It's 11:30 on a sat night and I'm fixing to go to bed...
Chris Blazek
|
|
|
|
|
Hello,
I am fairly new to .NET and wanted to ask recommendations on the proper use of sqlDataAdapters regarding using one sqlDataAdapter on each form created or, what is the best way to centrally setup the sqlDataAdapters that each form can access the same sqlDataAdapter. In Delphi, there is a DataModule (threaded) that allows you to put your non-visual data access components on it and then access the DataModule from each form or function that needs data access.
What might be some articles or references to a question like this?
Thank you,
|
|
|
|
|
A SqlDataAdapter is simply that: an adapter that fits between a DataSet or DataTable and one or more SqlCommand s - one to select data, the SelectCommand property, and up to three others to update, insert and delete data (UpdateCommand , InsertCommand and DeleteCommand , respectively).
There are basically two ways to access data in a database with ADO.NET. The simplest, where you just need to fetch a result set from the database and do something with it quickly (e.g. export to a file, display on screen) is to use a SqlDataReader , which you obtain by calling ExecuteReader on the SqlCommand object. If the query you're executing only returns a single value, or you only want the value of the first field in the first row of the result set, consider ExecuteScalar instead. If you don't care about the response at all, or there isn't one, use ExecuteNonQuery .
If you're familiar with classic ADO, a SqlDataReader is similar to a Recordset opened with the adOpenForwardOnly and adLockReadOnly options. You can't reuse the SqlConnection that you executed the command on until you have closed your SqlDataReader or read all the results (when Read returns False ).
For more complicated scenarios, where you need to access multiple result sets simultaneously, or you need to execute other queries against the result set, or the user needs to be able to update the data, ADO.NET provides DataSet and DataTable .
DataTable represents a cache of a result set, and offers many of the features from classic ADO, including editing and access to original and modified versions of rows. However, a DataTable is disconnected - any changes made to the DataTable are not reflected in the database until you use the DataAdapter 's Update method.
A DataSet is a collection of DataTable s and, optionally, relationships (DataRelation s) between those tables (for example, parent-child).
Classes listed above which begin with Sql are specific to SQL Server, and live in the System.Data.SqlClient namespace. The other classes (beginning Data ) are general and can be used with any provider; they live in the System.Data .
OLE DB equivalents of the Sql classes can be found in the System.Data.OleDb namespace. There are also so-called provider classes for ODBC and Oracle (downloadable from Microsoft for .NET Framework 1.0, and included in 1.1).
|
|
|
|
|
Hi,
Is there a method like "SetFieldNull" (a CDAORecordset method) in ADO programming ?
Thanks.
|
|
|
|
|
I am sorry if this seems off topic here,
but I'm not sure where else I could post this question,
and the people lurking in this forum probably know something of DBs,
and may know something that can help me, so...
...not to mention this problem is **killing** me !
Here goes:
I'm trying to set a dll to trace the ODBC communications.
The machine is running Win 2K 5.00 w/ SP-4.
I downloaded and installed the MDAC 2.8 and MDAC SDK 2.6.
From the MDAC SDK I got the source code for the trace.dll.
So I compiled it in Visual Studio 6.0, and I obtained the
trace.dll.
Now, in the Administrative Tools>Data Sources, in the
Tracing tab, I click on "Select DLL", navigate to the
location of the trace.dll, and click "OK.
When I click "OK" or "Apply", I receive the error message:
"General Error: either C:\WINNT\system32\trace.dll is not
an ODBC tracing dll or it is obsolete."
with an "OK" button.
Well... I'm not Ok with it, but I can only click on it...
After Ok-ing the error message, the DLL in the "Custom
Trace DLL" text box (in the Data Source > Tracing tab)
reverts to "C:\WINNT\system32\odbctrac.dll", which was the
value in it before I tried to change it.
I looked at the dependencies of the two dlls involved, to
check if I was not exporting something.
I noticed that the trace.dll was not listing all of its
routines.
So I added a trace.def file to my project, listed all of
the routines to be exported (I think), and tried again.
Now the trace.dll shows the various routines when I "View
Dependencies" on it, but the rest of the scenario has not
changed.
Last attempt (after long research on the net)
was to modify the signature of the routines to be exported
so that they are preceeded by __declspec(dllexport)
to ensure that they are being exported, but nothing changed...
....Suggestions?
Thanks in advance for your attention,
Frank
|
|
|
|
|
[mode="supplicant"]
..please ?
[/mode]
F.O.R.
|
|
|
|
|
A couple of things spring to mind:
Are the functions declared extern "C" if compiled as C++?
Is the TraceVersion function returning the correct version number?
|
|
|
|