|
Anonymous wrote:
"Should the 2 tables be of same design structure"?
No, you can define the transformation, which field to copy and the desination
field.
<italic>Work hard, Work effectively.
|
|
|
|
|
Does anyone know of a programmatic way of finding which server(s) may be running, so a new client installation can be provided with a drop-down list of where the data may be held? There will be a defined instance in each case, so all servers to be found will be of the form "machinename\myinstance" - I just need to find possible values for 'machinename'. (pretty much like the facility in Enterprise Manager for finding a new server registration).
We are using C# (.NET 2003) but I can translate from other methods if required.
|
|
|
|
|
|
Many thanks Luis. This looks perfect.
And it seems I need to keep up with the times, Google is getting good for this sort of thing.
|
|
|
|
|
You're welcome. I'm glad I could help!
Google is really awesome. I've seen that 95% in less than 2 minutes I find what I'm looking for. And here in CP you can find many articles about almost everything!
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
Is there a limit on reading resultsets with thousands of row?????????
|
|
|
|
|
|
Hi Guys & Gals, I am a beginner and used these commands to insert user input from a textbox to MS Access database. Whenever the submit button is clicked, the database Autonumber increases but the "Name" field is blank. Really need help guys. Thanks in advance.
Me.OleDbInsertCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("Name", System.Data.OleDb.OleDbType.VarWChar, 50, "Name"))
Me.OleDbInsertCommand2.CommandText = "INSERT INTO Name (Name) VALUES ('" & InputName.Text & "')" <<<<<<<<< declaration of the INSERT command
Me.OleDbInsertCommand2.Connection = Me.OleDbConnection1
.
.
.
.
PrivateSub Submit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Submit.Click
Try
OleDbConnection1.Open()
OleDbInsertCommand2.ExecuteNonQuery() <<<<<
|
|
|
|
|
Why are you adding a parameter (name) to the command object if you don't intend to use it? Yopur commandtext just concatenates the value into the insert string, which does not reference the parameter.
Things are likely to get pretty confused however, since you have a table named 'name', which contains a column named 'name', and your parameter is called 'name'.
My suspicion is that since the parameter name matches the field name, things are really bolloxed up and the provider endes up looking for the value in the name parameter, but it still has a null value, which is what is used.
I would comment out the parameter addition, and see if that fixes things. I would also consider getting a wee bit more creative with the names, making them different enough so I wouldn't get lost.
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
The opposite of the religious fanatic is not the fanatical atheist but the gentle cynic who cares not whether there is a god or not.
Eric Hoffer
|
|
|
|
|
Hello friends!!
I observe that sometimes my queries took 2 0r 3 sec and sometimes it took 1.30 min or 2 mins
that might be problem due to some other user access same table or view??
already i optimised my query but still it took sometimes little bit long time!
if soem other user access the same table then is there any process to lock the table or waiting option ????
please help me out!!!
T.I.A
Shashank
|
|
|
|
|
if another user opens the table for exclusive use before you do, it will be locked until he closes it. IIRC The default locking scheme depends on the version of access in use, and connection string defaults' Some can be modified by the connection string or connection properties see this[^] for more information
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
The opposite of the religious fanatic is not the fanatical atheist but the gentle cynic who cares not whether there is a god or not.
Eric Hoffer
|
|
|
|
|
Hi everyone
Is there a quicker and more efficient way of importing data programmatically from a table in database A into a table in database B using a C# windows application?
At the moment I open the connection to database A and read the data form the table into a dataReader object. Then I open the connection to database B, loop through the datareader and insert the data into the table in database B.
Thanks.
Kobus
|
|
|
|
|
I am writing a C# windows app with a MS Access database.
What I would like is to have a query that will delete a specified number rows from the data table that match a criteria. Note I do not want to delete all the rows that match the criteria justa specified amount.
For example my table contains 50 rows of which 30 match the criteria but I want to delete 15 of them, any 15 will do.
|
|
|
|
|
Delete top 15 * from mytable where...
if there are fewer than 15 will delete them all.
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
The opposite of the religious fanatic is not the fanatical atheist but the gentle cynic who cares not whether there is a god or not.
Eric Hoffer
|
|
|
|
|
Hi!
I'm facing an error when i'm testing my program. The error is: If i query, insert ... a big sum of data forward and backward from my SQL Server to my app continuous, a little later, my app can't do any query to SQL Server anymore (even a simplest query string : select * from ...).
I don't know why it is happened? Anyone can help me please! I'm too anxious! I don't want my app just can process with a little data
Thanks!
(I'm sorry if my English is too bad )
|
|
|
|
|
You didn't mention what language your application was written in.
Are you remembering to close your connection to the database when you are finished with it.
If you are using a .NET language such as C# or VB.NET are you callng Dispose on your connection object?
Michael
CP Blog [^] Development Blog [^]
|
|
|
|
|
Yes, i did remember close the connection when i am finished but i don't understand the dispose() you recommended here. When i want to query or insert database, i often code it like this:
conn.open();
comm.ExecuteNonQuery();
conn.close();
Am i missing something ?
My application was written in C#.
Thanks your reply
|
|
|
|
|
|
I'll try it! Thanks!
|
|
|
|
|
I have a decimal value 23.25 . When i use the math.round(23.25,1) in VS.NET, the result is 23.2 but with the function: round(23.25,1) in SQL Server 2000, the result is 23.3
How can i let them return the same value ?
Thanks!
|
|
|
|
|
SQL and .Net use different rounding algorithms (as you have observed), ao the answer is that you can't. Net's version is the more 'proper' algorithm: it returns the nearest even number when the value is half way between (.25 will round to .2, .35 will round to .4) This yeilds more accurate averages and totals for the rounded data, and so is prefered. It is sometimes called "Banker's rounding". SQL always rounds to the next larger number for the mid value, which leads to totals and averages that are biased to the high side.
I would recommend choosing the rounding behavior that you prefer, and always doing the rounding that way (i.e. either have ONLY SQL do the rounding, or ONLY .Net). I suspect that returning unrounded values from SQL and doing the rounding in .Net would be marginally more performant.
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
The opposite of the religious fanatic is not the fanatical atheist but the gentle cynic who cares not whether there is a god or not.
Eric Hoffer
|
|
|
|
|
I need help i am trying to creat a program in VB.net for a pda.
i already have the database created using the quary analizer.
but i can not get the connection to work.
Public Sub conn()
Dim conn As New SqlCeConnection
conn.ConnectionString = "Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0; Data Source=\My Documents\abook.sdf;"
end sub
but i keep getting exceptions
i have searched threw several examples but they all start out by creating the database or using XML.
all i want is to retrieve data and manipulate it.
please some one explane what i am doing wrong, and a good example of what i need to do.
|
|
|
|
|
what is the error being reported in the exception?
And don't you need some kind of authentication in the connection string?
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
The opposite of the religious fanatic is not the fanatical atheist but the gentle cynic who cares not whether there is a god or not.
Eric Hoffer
|
|
|
|
|
I've made a table in access with a columnfield "searchdate"
Now I want to filter rows between two dates in the columnfield "searchdate" using two datetimepickers. I'm using the (configure)oldedbadapter with the querybuilder with the following SQL-expression :SELECT...FROM...WHERE ([searchdate] >= ?) AND ([searchdate] <= ?)
My code : oledbdataAdapter.selectCommand.parameters("searchdate").value = datetimepicker1.value.date
oledbdataAdapter.selectCommand.parameters("searchdate").value = datetimepicker2.value.date
dataset.clear
oledbdataadapter.fill(dataset)
result: it doesn't work!!!
if I'm using the expression select....from...where ([searchdate] >= ?)and ([searchdate]<= #01/12/2005#)he finds the records beween a date chosen with the datetimpicker1 and the date 01/12/2005.
Can somebody help me how to find rows beween two dates using two datetimepickers bound two one columnfield "searchdate"
Thank you very much for answering to my question.
Boutie
|
|
|
|
|
You are giving both dates the same parameter name, so the result is that you are asking for all the records between the same dates: dateTimePicker2 is 5-9-2004 then the query becomes: select...from...where [searchdate] >= #05/09/2005# and [searchdate] <= #05/09/2005#
Instead of using the field name as a parameter name, use some arbitrary names like p1,p2 so each of the two parameters in your query have different names. add tem to the parameters collection and set their values in the order they will be used in the query (the oledb layer doesn't care about the parameter names, just the order; but the .Net collection object (the parameters collection of the query) wants unique parameter names)
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
The opposite of the religious fanatic is not the fanatical atheist but the gentle cynic who cares not whether there is a god or not.
Eric Hoffer
|
|
|
|