|
Your server time is different from your local time?
Mazy
"Man is different from animals in that he speculates, a high risk activity." - Edward Hoagland
|
|
|
|
|
Yes, the server is remote one and client application that requests data is local one with 6 hr time difference and different locale too
JDotNet
|
|
|
|
|
So web method return time in server local. Thats all.
Mazy
"Man is different from animals in that he speculates, a high risk activity." - Edward Hoagland
|
|
|
|
|
That's nice, but it modifies the data!!!
This action is taken without asking, on the background. And what if I don't care about this fantastic feature? I just want to get what was sent to me, as is.
This looks ridiculous, don't you agree?
|
|
|
|
|
Hello all.. i need your help again.
I'm use CDatabase and CRecordSet to access to my access database.
forexample myTable have two rows, row1 and row2. row1 contains texts, row2 contain numbers
as shown below.
r1 | r2
___________
a | 1
a | 1
b | 2
c | 1
a | 1
c | 5
d | 5
d | 9
a | 3
I want only a,b,c,d from row1 not entire column, so I wrote the following code to get select the data that I want. but it still giving me entire column instead of only a,b,c,d
could you please point me out that what am i doing wrong?
<br />
CDatabase db;<br />
MyCRecordSet rs(&db);<br />
db.open.....<br />
rs.open...<br />
<br />
CString qstr = "SELECT DISTINCTROW r1 FROM myTable";<br />
rs.m_pDatabase->ExecuteSQL(qstr);<br />
if(rs.ReQuery())<br />
{<br />
while(!rs.isEOF())<br />
{<br />
MessageBox(rs.rOneData);<br />
}<br />
}<br />
<br />
thank you
|
|
|
|
|
pnpfriend wrote:
CString qstr = "SELECT DISTINCTROW r1 FROM myTable";
should be "SELECT DISTINCT r1 FROM myTable";
pnpfriend wrote:
myTable have two rows, row1 and row2
I think you meant myTable have two Columns, r1 and r2
and you want one row for each unique value in column r1
"select distinct" will do that. select distinctrow retuns all the rows that are not duplicates (all column vaues equal).
Power corrupts and PowerPoint corrupts absolutely. - Vint Cerf
|
|
|
|
|
yes.. i meant myTable have two columns, r1 and r2
i think i have to use distinctrow, since you said that
distinctrow returns all the rows that are not duplicates meaning
if i use distinctrow i will get a,b,c,d from r1 as I wanted.
anyway i tried both and it is not giving me the answer i wanted.
<br />
CString qstr = "select distinctrow r1 from myTable";<br />
rs.m_pDatabase->ExecuteSQL(qstr);<br />
if(rs.ReQuery())<br />
{ <br />
while(!rs.IsEOF())<br />
{<br />
MessageBox(rs.r1Data);<br />
rs.MoveNext();<br />
}<br />
}<br />
<br />
keeping giving me entire r1 column data.
is it because of rs.IsEOF() while loop??
is is CRecordSet will have the record of whatever record set of sql query statement executed and return??
|
|
|
|
|
The DISTINCTROW only eliminates duplicate records from the query result; it does nothing to qualify the selection. You need to include a WHERE clause in the query to define what records you want returned. Adding the clause WHERE r1 >= 'a' AND r1 <= 'd' (or whatever is syntactically correct for Access) will filter the resulting recordset so that it contains only records that meet the specified criteria. Also, specifying r1 as the only value returned is probably not what you intend - try SELECTing * to return entire records.
Will Build Nuclear Missile For Food - No Target Too Small
|
|
|
|
|
ExecuteSQL lets you send SQL-Commands to the Database directly, but it doesn't change the recordset (you can prove by examining the m_strSQL member)
to use aggregate functions and the like (sum, count, distinct, ...) you have to modify the DopFieldExchange-function:
void
CDPDCount::DoFieldExchange(CFieldExchange* pFX)
{
pFX->SetFieldType(CFieldExchange::outputColumn);
RFX_Long(pFX, _T("COUNT(*)"), m_lCount);
}
hope it helps
dirk
|
|
|
|
|
Hello,
I am encountering deadlock issues when trying updating data from a dataset to a database using an adapter.
Can anyone tell me how to catch the error 1205 exception from my C# ADO.NET code so I can rerun the transaction?
Thanks!
Best regards,
Alexandru Savescu
P.S. Interested in art? Visit this!
|
|
|
|
|
Hello
How can a sql paramter in a sql command be mapped to a coputed column in a data table?
Thanks In Advance
|
|
|
|
|
First up, you can't set a computed column's value (unless, I think, you write an INSTEAD OF trigger).
If you want to set an output parameter, you need to set it in the body of your statement. I normally do this from a stored procedure - I'm not sure that you can use output parameters with a literal SQL statement.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Hi
Thanks for ur reply..BUT..i am talking in the context of ADO.NET not SQL Server.
I am trying to map sql command parameters of a sql command object to columns of a data table to update the table back to the DB.
It seems that ADO.NET does not allow such a mapping to COMPUTED columns (data columns with thier EXPRESSION property filled)
is there a work around?
|
|
|
|
|
hello ...
I have a big problem with an application.
with this application i have to open an access file on a server somewhere in the net.
the clients use my app to open this access-file.
i used ODBC, i use DAO ... but always there must be something installed on the clients that i can open the access-file (mdac, jet,...)
but i need a solution where i can start the app-exe on a naked client (no installation of jet before). it is ok, if dll's are in the app-directory ...
how can i do this ??????????????????????????????????
P.S. the database must be a file ... no server ...
|
|
|
|
|
You are out of luck, IMO. you will have to install at least MDAC & Jet on the client.
Power corrupts and PowerPoint corrupts absolutely. - Vint Cerf
|
|
|
|
|
des hätsch dir auch so sagen können (und ich glaub des hab ich auch schon
|
|
|
|
|
HI Friends,
I have installed two instances of SQL server on my machine.First one is default installaion and second instance is going to be Named Instance.I want to access the named instance of the SQL server through access workflow 2000.Is it possble ? If not how?
VikramS
|
|
|
|
|
The format is <computername>\<instancename> as described on http://msdn.microsoft.com/library/default.asp?url=/library/en-us/instsql/in_runsetup_2xmb.asp
JackDotNet
|
|
|
|
|
Hi Thanx for reply.Actually I have some workflows created using office 2000 on sql server 2000(default instance). Now I want to port this workflows over Office XP developer using sql server (named instance). Here I am using template for parting. While Instantiating the template it gives me follwing error dialog box
---------------------------
DCOM Server modTBAD failure
---------------------------
The wizard is unable to create an application from the template because the DCOM server modTBAD failed to successfully complete the task.
---------------------------
OK
---------------------------
Does Anybody know the problem soln?
VikramS
|
|
|
|
|
Hello...
I have the following situation :
One data set that contains two data tables, tblHeader and tblDetails. The two tables have a column in common (like a relation).
Dim con as New SqlCOnnection()
Dim da as New SqlDataAdapter()
Dim cmd as New SqlCommand("sp_insertrecord", con)
da.InsertCommand = cmd
da.InsertCommand.CommandType = CommandType.StoredProcedure
da.InsertCommand.Parameters.Add(New SqlParameter("@Param1", SqlDbType.VarChar, 40, strCol1))
da.InsertCommand.Parameters.Add(New SqlParameter("@Param2", SqlDbType.VarChar, 3, strCol2))
da.InsertCommand.Parameters.Add(New SqlParameter("@Param3", SqlDbType.VarChar, 10, strCol3))
as U can see strCol1,strCol2 and strCol3 are source columns that map to the columns that i want to update. The problem is that I have col1 in tblHeader and Col2 and Col3 in tblDetails....
when I execute
da.Update(ds,tblDetails.TableName)
I get an error stating the sp_InsertRecords expects paramter @Param1 that was not supplied.
I guess that the situation is happening because I have one row in the header table and 3 rows in the details table...
How can I map the paramter to the correct column name in the second table??..how should i modify my da.update statement???
what I need is a sort of an INNER JOIN in ADO.NET..is there such a thing??
Please Help Me
Thanks In Advance
|
|
|
|
|
Hi guys
I wonder if it is possible to select some range of rows from a teble. For example suppose that I want to retrieve 12th-24th records from a table which has 100 records. Is it possible? If so, what is the SQL query?
abcdabcdabcdabcda
Don't forget, that's Persian Gulf not Arabian gulf!
Murphy: Click Here![^] I'm thirsty like sun, more landless than wind...
|
|
|
|
|
You should use TOP keyword in combination of ORDER BY, something like this:
SELECT TOP 12 FROM table ORDER BY primaykey DESC WHERE primarykey < 24
Maybe this statement doesn't work, but you should find it with TOP keyword.
Mazy
"Man is different from animals in that he speculates, a high risk activity." - Edward Hoagland
|
|
|
|
|
I want to do that independent of primary key.
abcdabcdabcdabcda
Don't forget, that's Persian Gulf not Arabian gulf!
Murphy: Click Here![^] I'm thirsty like sun, more landless than wind...
|
|
|
|
|
yes but 12th - 24th based on what sort criteria?
just change the order by criteria in mazzy's example and it will work
"there is no spoon" biz stuff about me
|
|
|
|
|
m a y s a m wrote:
I want to do that independent of primary key.
Do you eat food with your legs?
Mazy
"Man is different from animals in that he speculates, a high risk activity." - Edward Hoagland
|
|
|
|