|
Have you looked at what is going on in the following line?
cmdSetHours.Parameters.Add("@TotHours",SqlDbType.Decimal).Value = decTotalHours;
I tried to replicate your problem from the database side, and couldn't I would suspect something going on with the setup for the stored procedure.
I hope this helps some,
Paul
|
|
|
|
|
Well, in the debugger, the paramTotHours = #.## ( whatever that value may be)
Thanx again
-- modified at 19:10 Friday 10th February, 2006
Got it...didn't define the parameter correctly, as in
@TotHours decimal (5,2).
Thanks for the help again!
|
|
|
|
|
I need to find a way to change the background color of rows in my DataGridView if the row is marked as modified. Note that this is not the same as changing the background color of a cell when its value changes. The latter can be done easily through the CellValidating and CellValidated events, though this is completely unsatisfactory because the change in color gets lost when you sort a column. But I need the whole row's background color to change.
This seems to imply to me that I need to override the cell classes to override their Paint handlers. The difficulty with this is that in the Paint handler of a cell I can't find a way to get access to the cell's bound DataRow to tell if its RowState is modified. I can only see a way to get hold of the DataRow for the currently selected grid row, not for any row in general. If the grid has been sorted, then you cannot use the cell's grid row to index correctly into the dataset's table.
Any definitive help would be greatly appreciated.
-- modified at 12:12 Friday 10th February, 2006
|
|
|
|
|
can i use a subquery field to my main query.
i.e
select x.field1,y.field2
from tbl1 as x
where x.field3 not in (select y.field3 from tbl2 as y)
|
|
|
|
|
Yes, do be aware that a 'not in' query can be very lengthy if your tables are large.
|
|
|
|
|
thanks,
than what can i do ?
|
|
|
|
|
Sorry - didn't see your reference of y.field2 in the SELECT. Your original query will not work.
You can try a left join:
SELECT
x.field1,
y.field2
FROM
tbl1 x
LEFT JOIN
tbl2 y
ON (x.field3 = y.field3)
WHERE
y.field2 IS NULL
-- modified at 14:37 Friday 10th February, 2006
|
|
|
|
|
thanks, through it i solved my problem.
thanks again.
|
|
|
|
|
try this,may work.
select x.field1,y.field2
from tbl1 as x,tbl2 as y
where x.field3 != y.field3
青山隐隐水迢迢,秋尽江南草未凋。二十四桥明月夜,玉人何处教吹箫。
|
|
|
|
|
The above will work, although you could also just do a normal inner join and use an inequality instead of the usual equality join, instead of the above example with a cartesian product and a where clause.
SELECT x.field1, y.field2
FROM tbl1 as x
INNER JOIN tbl2 as y
ON x.field3 != y.field
|
|
|
|
|
Hi
what is the difference between joins & sub query?
what is the difference between having & compute?
tnx in advance
-ramani
|
|
|
|
|
|
Hi friends,
I have been developed one clien-server application using VB.NET and ADO.NET tech's. I installed my application and MS SQL Server 2000 in server system. but when I am going run the application at Client system it gives the error message as : "Server access denaied" and/or "Unable to connect the server system."
But my application is running perfectly after I installed the Database server at client system without current working datebase.
So I feel that it is required to install the MS SQL server on both server system and client systems. I am not interesting to do in this way.
Kindly, give me the proper solution for problem.
wish me as All The BEST.
|
|
|
|
|
There is no need to install MS SAL SERVER on client end.
Just provide the Server name at the client in your application
server name may be the IP address or the Server name.
|
|
|
|
|
Also install MDAC 2.7 on client machine.
It will definatly work.
Pankaj Kulkarni
|
|
|
|
|
It'll work so long as he built the connection string properly...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I'm new to SQL, so forgive my ignorance.
I have a number of related tables. Of these there are 3 which are of concern to my problem: Invoices, InvoiceItems and Products. There is a 1:M r/ship between Invoices as well as between Products and Invoice items. The Invoice items table has InvoiceItemID, InvoiceID, ProductID, Quantity and Price.
I would like to add 3 InvoiceItems as records in my InvoiceItems table and i would like to have them related to one Invoice (the last Invoice in my case) in the invoices table, that is, also the field in the InvoiceItems called InvoiceID for these 3 records should have the same InvoiceID. All the Primary Keys are set to AutoNumber.
These are the the statements i used:
INSERT INTO InvoiceItems ( InvoiceID, ProductID, Quantity, Price )
VALUES (4, 8, 1, 0);
INSERT INTO InvoiceItems ( InvoiceID, ProductID, Quantity, Price )
VALUES (4, 9, 4, 0);
INSERT INTO InvoiceItems ( InvoiceID, ProductID, Quantity, Price )
VALUES (4, 10, 2, 0);
I would like to do this using some sort of INSERT SQL statements, but it's just not working. I can INSERT one InvoiceItem, but when i try to INSERT the next one i get some long error saying something about "type conversion failure","key violations", "lock violations" and "validation rule violations"
Does anyone know why this is happening and how to correct it?
Any help would be much appreciated.
|
|
|
|
|
I think you have not entered the master data
ProductID Name
8 ABC
InvoiceID Invoice Name
4 ZXZ
InvoiceID ProductID Qty Price
4 8 1 0 ----> ok
4 9 4 0 ----> ProductID is not existing
4 10 2 0 ----> ProductID is not existing
I think ! This is the problem
|
|
|
|
|
Thanks ... you were right
...i can't believe it was something so small
|
|
|
|
|
Hi;
I am using SQLXML 4.0 for loading bulk load data. I'm having a problem with connectionstring, when I use sqlclient i.e. sqlconnection it gives me error and does not connect to the database. When I use the connection string providing SQLOLEDB provider it works.
private static SqlConnection getConnection()
{
SqlConnectionStringBuilder conStrBuilder = new SqlConnectionStringBuilder();
conStrBuilder.DataSource = "abc";
conStrBuilder.InitialCatalog = "abc";
conStrBuilder.UserID = "abc";
conStrBuilder.Password = "abc";
return new SqlConnection(conStrBuilder.ConnectionString);
}
private void ExecuteBulkLoad()
{
SqlConnection conn = getConnection();
conn.Open();
SQLXMLBulkLoad4 objXBL = new SQLXMLBulkLoad4();
try
{
objXBL.ConnectionString = conn.ConnectionString; // it does not work
objXBL.BulkLoad = true;
objXBL.ErrorLogFile = @"C:\SQLXML3Books.errlog";
objXBL.KeepIdentity = false;
objXBL.Execute(@"C:\booksmapping.xml", @"C:\Books.xml");
}
catch
{
throw;
}
finally
{
// close of the writer and the stream objects.
objXBL = null;
}
}
But if I use objXBL.ConnectionString = "provider=SQLOLEDB.1;data source=abc;database=abc;uid=abc;pwd=abc";
It worked fine.
Any help?
Thanks
M. Essa Mughal
Toronto, CANADA
|
|
|
|
|
Hi;
I've just started playing with SQLXML 4.0, here is the code which I am using to load the XML into database.
SQLXMLBulkLoad4Class bulkLoad = new SQLXMLBulkLoad4Class();
bulkLoad.ConnectionString = connString;
bulkLoad.BulkLoad = true;
bulkLoad.KeepIdentity = false;
bulkLoad.XMLFragment = true;
bulkLoad.Execute("C:\books.xsd", "C:\books.xml");
My question is that, the mapping file i.e. xsd or booksmapping.xml is compulsory to pass or we can have that information into xml data file? We want to avoid two files to maintain.
Thanks
M. Essa Mughal
Toronto, CANADA
Email: essamughal@yahoo.com
|
|
|
|
|
Hello everyone,
I have been working with VBA code in MS Access 2003. I have a Command button which sends an email and then update the column of a table. Here is what I have...
<br />
DoCmd.SendObject, , acForMatTXT, strWho, , , strSubject, strText, -1<br />
strSQL = "UPDATE [Action Item Table] SET ysnActionAssigned = -1 " & _<br />
"Where [Action Item Number] = " Me.Action_Item_Number & ";"<br />
On Error GoTo Err_Execute<br />
CurrentDB.Execute strSQL<br />
on Error GoTo 0<br />
<br />
Err_Execute:<br />
' Here I display error message in a message box<br />
I am getting an error of "Type mismatch". Can someone tell me what is going wrong.
Thank you.
Bashar Amin
Sr. Software Engineer
|
|
|
|
|
Which line is triggering the Type Mismatch?
|
|
|
|
|
CurrentDB.Execute strSQL
When executing the SQL command.
Bashar Amin
Sr. Software Engineer
|
|
|
|
|
Are you explicitly using Dim to create the variable strSQL as a string?
|
|
|
|