|
This might be because of your design. Where are you setting the filter? Is the filter executed again after you change the row? If not then the program is doing what it is supposed to do. Just debug and see if it hits the filter again after changing the value.
|
|
|
|
|
What do you mean with "where are you setting the flter"? Well I set the filter. then the value is changed. Afterwards the row still is displayed, but that´s not what bothers me. When I set the filter to something else and afterwards set it back to the iriginal filter the row with the changed value still shows up, even though it doesn´t match the filter anymore.
any ideas?
|
|
|
|
|
Hi,
In SQL 2005 we have Formula Dialog Box [Model Designer] to compute field values in a table.
How to perform the same operation (computing a field value in table) using SQL server 7.0 ? I didn't find any option to compute during designing the table. Have I to write explicit triggers/function for it ?
Please help me ....
Thank you in advance !
Vardhini Kanakarajan
|
|
|
|
|
Hi!
I thought i was heading somewhere with those links Blue_Boy had sent.. but i've been stuck for quite a while now. So let me describe my problem in more detail: Plese help me
I have 2 datasets, with identical schema. Now i have merged them using the dataset1.merge(dataset2) method. So my dataset1 is a merge of the two datasets. Now when i try to update the database of dataset1 using dataadapter.update().. method, i dont see the database getting updated.This is the code snippet...
<br />
OleDbCommand accessCommandDB1 = new OleDbCommand(strAccessSelect, accessConnDb1);<br />
OleDbDataAdapter dataAdapterDB1 = new OleDbDataAdapter(accessCommandDB1);<br />
OleDbCommandBuilder commandBuilder = new OleDbCommandBuilder(dataAdapterDB1);<br />
<br />
dataSetDB1.Merge(dataSetDB2);<br />
<br />
n = dataAdapterDB1.Update(dataSetDB1, "Customers");<br />
<br />
I see that no records are updated, from the value of n(n =0 after the call)
What could be the reason? Note that i dont have any primay keys to any table in my database
Also wanted to know how to polpulate a fresh empty ACCESS database, with my dataset.. Again no primary keys for any table.. i would prefer this over the update method..
Please help me at the earliest..
Awaiting your replies....
Shreyas
|
|
|
|
|
I've never used the merge and there isn't very clear info on it on msdn. But I did notice that it is overloaded. What happens when you try to use dataSetDB1.Merge(dataSetDB2, True) instead?
|
|
|
|
|
I have tried that as well. It doesnt work.
But i am sure the merge has worked because i am printing certain values to confirm it.. Si i guess its some update issue.. Right?
Btw, how do i populate an empty access database with my dataset?
|
|
|
|
|
When you say "empty" do you mean that it doesn't have any tables? Because I'm thinking you'd have to write code to build create sql statements and excute them against the database file.
|
|
|
|
|
Yes, i mean a newly created database, with no tables. So will i have to manually add all tables to it? Or is there something like setting its datasource to the new dataset?
What if i have a new database with the same schema, but no tuples in the tables?
|
|
|
|
|
If you have a database with no tables, you will not be able to save data to it until you create those tables. You could probably write some code to dynamically build the tables by looping through the schema of your dataset object and building sql CREATE TABLE statements that you can run from a command object via the .ExecuteNonQuery function.
If you have a database with the same schema as a dataset, you should be able to use the .Update on the command object and save your data to it.
If you need more help regarding the CREATE TABLE statement, try looking for articles in Code Project or on Google[^] for more background information to get you going.
Hope this helps.
|
|
|
|
|
|
Thanks for your help!
Btw, dont know why the update didnt work, but i did manage to insert all rows into the database, by generating queries for each tuple..
Shreyas
|
|
|
|
|
hi
how can i select the Minmam value from row that have many coulm
like
select * from room where Capacity >= SumCapacity and featuer='0000'
how can i chose the Minmam Capacity that are grater than SumCapacity
and have the featuer '0000'
please i need help
|
|
|
|
|
1. Can you post your data how they are stored in table?
2. Can you post the result which you want to get?
I Love T-SQL
|
|
|
|
|
RoomID Capacity Feature
11 40 1100
13 35 1000
137 60 1100
138 92 1100
i have many room that have the same featuer and i want to chose the room that are its size greater than the sumCap ( i have many room that are grater than the sumCap and i want to chose the one that have the minman capacity from them )
i hop you can help me
|
|
|
|
|
I can't undestand well your question but down below is what i undestand from your question.
asha_s wrote: i have many room that have the same featuer and i want to chose the room that are its size greater than the sumCap
I think this fits to your need.
select sum(capacity) as CapacitySum,feature,<br />
(select top 1 t1.roomid from myTable as t1 where t1.feature = myTable.feature order by t1.roomid desc) as roomID<br />
from myTable <br />
group by feature<br />
order by CapacitySum desc
asha_s wrote: ( i have many room that are grater than the sumCap and i want to chose the one that have the minman capacity from them )
the second fit for you.
select top 1 sum(capacity) as CapacitySum,feature,<br />
(select top 1 t1.roomid from myTable as t1 where t1.feature = myTable.feature order by t1.roomid desc) as roomID<br />
from myTable <br />
group by feature<br />
order by CapacitySum asc
I Love T-SQL
|
|
|
|
|
thanks but i do not want the sum
sumcap:is variable that contain value
i want the room than have the manmam capacity from a set of rooms that are their capacity greater than sumcap
because i have a set of room that have capacity greater than sumcap and
have the same feature and i want to select the one that have the manimam capacity
i hop you understand
please help
|
|
|
|
|
By manmam you mean minimum? (I hope I had understand you even if i didn't got it 100%)
select top 1 min(roomID) as RoomID,feature from myTable where roomid >=sumCap<br />
group by roomid,feature<br />
having (feature='1100')<br />
order by roomID asc<br />
I Love T-SQL
|
|
|
|
|
yes i mean minimum
can i want the minimum capicity can i write
select top 1 min(Capacity ) as Capacity,feature from myTable where Capacity >=sumCap<br />
group by roomid,feature<br />
having (feature='1100')<br />
order by Capacity asc<br />
thanks so much
|
|
|
|
|
I guess you got right solution, right?
I Love T-SQL
|
|
|
|
|
yes ,thanks so much
|
|
|
|
|
Cool, you are welcome.
I Love T-SQL
|
|
|
|
|
i'm using SQL Server 2005, Windows XP SP2, Visual Studio .Net 2003, AVG anti-virus, no firewall, no proxy.
i configure IIS (virtual directory) and SQL Server (publication) as described in Miscrosoft web site.
i installed Microsoft SQL Server 2005 Mobile Edition and configured for web sycronization. i tried everything which mentioned in many blogs, forms and msdn but i recieve the error "Header Information is either is corrupted or missing..."
When i type "http://[Server IP]/[Virtual Directory]/sqlcesa30.dll", it return a valid result but i cannot connect to SQL Server for Pull or Push or SubmitSql process.
here is my code
string rdaOleDbConnectString = "Provider=SQLOLEDB;" +
"Data Source=" + MainForm.ServerIP + ";" +
"User Id=" + MainForm.DBUserID + ";" +
"Password=" + MainForm.DBPassword + "; " +
"Initial Catalog=" + MainForm.DBName + ";";
SqlCeRemoteDataAccess rda = null;
try {
rda = new SqlCeRemoteDataAccess();
rda.InternetLogin = MainForm.WebUserID;
rda.InternetPassword = MainForm.WebPassword;
rda.InternetUrl = "http://" + MainForm.ServerIP + "/" + MainForm.WebDir + "/sqlcesa30.dll";
rda.SubmitSql(txtQuery.Text, rdaOleDbConnectString);
MessageBox.Show("The query execution is successfull");
}
catch (SqlCeException exc){
MessageBox.Show(exc.Message);
return;
}
finally{
rda.Dispose();
}
is there any suggestions?
|
|
|
|
|
abdurrahman o wrote: is there any suggestions?
Yes, read about this error.[^]
I Love T-SQL
|
|
|
|
|
i read and applied them all. Nothing was changed.
I can access http://Server/Term/sqlcesa30.dll.
but i cannot access the same object "sqlcesa30.dll" in C#, gives an error "Header information is either corrupted or missing..."
|
|
|
|
|
I recently wrote an application in C# 2005 and used MSSQL as the backend. After successful completion, I added an Access .mdb file to the app so that I could make it portable. I changed the code appropriately from SQL Command to OLEDB Command, but it does not work. This is the rub: I do not get an error and it will not return results when it is run from inside the program, however, when I copy the command line that fails and paste it directly into the Access Database query tool and run it, it returns a perfect result. I am baffled! I have the feeling that there is a syntax difference between the MSSQL and Access, but I cannot discover it, nor would that explain why it works correctly when it is pasted into the program directly. Following is the SQL that comes directly from the program:
"SELECT DISTINCT T.Trans_Name AS Transmission, M.Manufacturer, M.Concern, M.Years, M.Description, M.ATB " +
" FROM Master AS M INNER JOIN Trans AS T ON M.Trans = T.Trans WHERE M.Manufacturer = @Manufacturer "
Any insight would be greatly appreciated.
Pat
|
|
|
|