|
I'm using OleDBCommand.ExecuteReader(CommandBehavior.KeyInfo)
Now, in the result DataTable, columns that have default values set in database, appears with DefaultValue property equal DBNull.Value
I tried everything; every CommandBehavior, dealing with SQl Server or MS Access, using DataAdapter instead of DataReader,... but no way ((
Pleaaaaaaaase help
|
|
|
|
|
Hi all, I got it
use OleDbConnection.GetOleDbSchemaTable Method ...
don't ask me whyyyyyy Microsoft does that
anyway..
here is an example:
DataTable SchemaTable = connection.GetOleDbSchemaTable(
OleDbSchemaGuid.Columns,
new object[] { null, null, "Employees", null });
you will find a column in "SchemaTable" datatable with name "Column_Default"
Good Luck
|
|
|
|
|
Now I have a new problem...
The retrieved value for Default Value is not in a usable format, it is retrieved as it is stored in database
for example:
In SQL Server, nvarchar field's default value is stored as follow
('value') or (N'value')
In MS Access, Text field's default value is stored as follow
"value"
Now, how can I get the value without quotes regardless of database type
|
|
|
|
|
Hi friends,
My existing project does db operation with help of MSMQ.
Consider following steps ;
1.Main Application writes binary dataa to MSMQ
2.Sub application reads data from MSMQ and update DB.
I have tried this with service broker
1.Main applicate puts data into Database Queue through Service broker
2.Service broker does DB operation.
But Comparatively the performance in service broker is very very slow.
I have used Binary data which passes through Queue and i have used CLR enabled stored procedure to use this bianry data.
Can any one explain wats wrong in this.
|
|
|
|
|
i have a query in sql2000
if i want to select distinct scid,requirement,comments from table1
i am not getting distinct rows .
distinct keyword is not working .can you please give me some clue.it is urgent.
|
|
|
|
|
My guess is that the DISTINCT keyword is working but that your rows aren't - well - distinct.
|
|
|
|
|
its taking more than two columns combined distinct
|
|
|
|
|
Yes, that is how DISTINCT works. The entire selected row must be identical to others for them to be filtered away.
|
|
|
|
|
Distinct runs on every column after it unless you put the column list in parenthesis () like
SELECT Distinct(col1), col2,col3
you can also group columns in the distinct clause or combine them if they are character strings like
SELECT Distinct (Col1 + Col2), col3
distinct will only operate on the column specified, but in your syntax you are accidently specifying all of the columns, and i imagine that you dont have 2 rows where all 3 columns contain the same data. Oh before i forget, Sql Server 2000's query analyzer tool has the absolute best help under help -> tranact SQL help. it is very well written and has fairly good examples, i use it all the time.
|
|
|
|
|
Do you have text or ntext columns in this table? because as I remember, distinct won't work fine with them.
|
|
|
|
|
can we use stored procedure in user defined function ?????
This is haneef.............................................................
|
|
|
|
|
Have you tried it? If so, and it works the answer is yes else no.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hi expets, I created a datagrid column as a templete column.It is a textbox field.So how i validate that templete column(textbox)?
CheeN
|
|
|
|
|
try the C# forum!
Bob
Ashfield Consultants Ltd
|
|
|
|
|
I should have guessed, you already did.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
i want to create a trigger to copy value inserted to another column on another table i have tried the following but failed.
invoice_summary >> table to copy from
Invoice_details >> table to copy to
create trigger Insert_InvoiceNum on dbo.invoice_summary
for insert
AS
begin
insert into Invoice_details select Invoice_num from inserted
go
regards
|
|
|
|
|
How has it failed?
Bob
Ashfield Consultants Ltd
|
|
|
|
|
error
Server: Msg 170, Level 15, State 1, Procedure Insert_InvoiceNum, Line 5
Line 5: Incorrect syntax near 'inserted'.
|
|
|
|
|
I suspect your InvoiceDetails table has more than 1 column so you need to specify why column to insert the value to
insert into Invoice_details(Invoice_num) select Invoice_num from inserted
Bob
Ashfield Consultants Ltd
|
|
|
|
|
same error raised
incorrect syntax near 'inserted'
|
|
|
|
|
can you post your table definitions? It might be a bit more obvious where the problem is.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Try placing an end before the "go".
Each time you have a BEGIN, you need an END.
|
|
|
|
|
it succeeded
but the insert value affected all rows i want it to affect 1 row only (new row)
hers is trigger syntax
create trigger InsertInvoice on dbo.Invoice_Summary
for insert
As
begin
insert into Invoice_details.Invoice_num select Invoice_num from Inserted
end
go
example :
insert into invoice_summary (P_name) values ('N1')
results:
the row insert to invoice_summary with Invoice_num 80
problem :
all invoice numbers in the invoice_details(invoice_num) is 80
should 1 row only added with that value
regards
|
|
|
|
|
Never overlook the obvious! Good spot.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
thanks .. but still have problem
|
|
|
|