|
Hi,
Sorry... Please ignore. It got resovled. It is checking with the PK_Value which is starting with 700. So I reset the PK_value. Issue is resolved now.
Sorry for the inconvenience caused.
Thanks,
Meeram395
|
|
|
|
|
I've always counted on a DataReader's RecordsAffected and FieldCount properties to tell me whether or not the command was a SELECT statement:
While the DataReader is open, use FieldCount; when the DataReader is closed, use RecordsAffected.
But I just ran into a snag... DDL statements, I hadn't tested my code with them until tonight.
While the DataReader is open, FieldCount properly indicates that it's not a SELECT statement; but when the DataReader is closed RecordsAffected == -1 so it tests as a SELECT statement!
Has anyone else run up against this and have a solution?
I don't think it'll really cause any trouble because by the time it's a problem the DataReader is closed anyway.
"
IDataReader.RecordsAffected Property
The number of rows changed, inserted, or deleted; 0 if no rows were affected or the statement failed; and -1 for SELECT statements.
The RecordsAffected property is not set until all rows are read and you close the IDataReader.
IsClosed and RecordsAffected are the only properties that you can call after the IDataReader is closed.
"
"
IDataRecord.FieldCount Property
When not positioned in a valid recordset, 0; otherwise the number of columns in the current record. The default is -1.
After executing a query that does not return rows (for example, using the ExecuteNonQuery method), FieldCount returns -1.
"
|
|
|
|
|
Hello I have a column in a datatable which has value
Title Book [Note values are in double quotes only]
"Does 'Grease Money' Speed Up the Wheels of Commerce?"
When I iterate the dataset I get the value as :
"\"Does 'Grease Money' Speed Up the Wheels of Commerce?\""
Hence I am not able to create an valid XML. Any idea how can I remove this \" from string
Regards,
Pavas
|
|
|
|
|
Sounds like code somewheres is adding the \ before you insert into the database.
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
Is that what you're seeing in the debugger tooltip or watch window in C#? For reasons best known to themselves, they show the string as you would have to write a string literal in the code. The outer quotes and backslashes aren't present, which you can confirm by sending it to Console.WriteLine .
I believe VB.NET shows doubled quote marks for the same reason.
DoEvents: Generating unexpected recursion since 1991
|
|
|
|
|
What the others said, plus that shouldn't keep you from producing well-formed XML unless you're doing something wrong.
I recently changed how I produce XML files, I used to do things like
string xml = string.Format
(
"<Book><Title>{0}</Title></Book>"
,
(string) datarow [ "Title" ]
) ;
Which will produce non-well-formed XML in many cases.
If that's what you're doing, look at System.Xml.XmlDocument.
|
|
|
|
|
Hi,
I'm currently working with the ADO.NET Entity Framework. The database design gots a anomaly with its tables.
The application design is a little bit awful. The user can login with different companies. So, USER1 logged in on company one, USER2 on company two and so on. For each company exists a copy of each table which can be identified via a prefix. If USER1 is logged in on company one his working tables got the prefix XXA_TableName. If USER2 is logged in on company two his working tables got the prefix XXB_TableName and so on. You don't have to tell me that this is a very dirty database design because i know that (it was not my brainchild).
What i need is to create entities at runtime because on design time i don't know on which company the user will log in. If the user log in on company one i have to create an entity for the table XXA_TableName. I hope this is coherent...
So, how can i create entities on runtime with the ADO.NET Entity Framework?
Kind regards
realmontanakid
|
|
|
|
|
Sounds like the person who created the database does not know how to normalize it. You might want to suggest they do that.
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
Hi,
thank u for your reply. Some things can't be changed at this time. However, is there an answer to my question?
Kind regards
|
|
|
|
|
I have 3 tables with below examples
dataTable
ID | DATA | ISBN
1 BOOK11 12312389123
2 BOOK22 12312389123
relationTable
AUTHOR_ID | ID
1 1
2 2
authorTable
AUTHOR_FIRST_NAME | Author_LAST_NAME | AUTHOR_ID
NAME NAME1 1
NAME NAME1 2
The relationTable acts as a relation datatable between "dataTable" and "authorTable".
I want to create relation between them in side a dataset. They all belong to a dataset named "MainDataSet"
Regards,
Pavas
<div class="ForumMod">modified on Friday, January 18, 2008 2:35:21 AM</div>
|
|
|
|
|
Considering ds as the dataset which contain all the three tables
ds.Tables["dataTable"].Constraints.Add("datpk", ds.Tables["dataTable"].Columns["id"], true);<br />
ds.Tables["authorTable"].Constraints.Add("authpk", ds.Tables["authorTable"].Columns["authorid"], true);<br />
<br />
<br />
ds.Tables["relationTable"].Constraints.Add("rtfk", ds.Tables["dataTable"].Columns["id"], ds.Tables["relationTable"].Columns["id"]);<br />
<br />
ds.Tables["relationTable"].Constraints.Add("rtfk2", ds.Tables["authorTable"].Columns["authorid"], ds.Tables["relationTable"].Columns["authorid"]);
Hope this helps!!!
Sathy
|
|
|
|
|
YES THIS helps !
Thanks!
Regards,
Pavas
|
|
|
|
|
its a pleasure
Sathy
|
|
|
|
|
Hi All,
Here's the Query from SQL 2000:
Select * from table1 <br />
Where Convert(DateTime,dtStTime,103) > = '17/01/2008'<br />
And Convert(DateTime,dtStTime,103) <= '19/01/2008'
????I want to have same kind of functionality query for Informix between ranges............
Please help as im new to Informix and im in midway of my project...
Bala
|
|
|
|
|
Hi,
Please try the following query:
SELECT * from Table1
WHERE DATE(dtstTime) > = '17/01/2008'
And DATE(dtstTime)<= '19/01/2008'
For more information on Informix SQL please visit the following web links:
http://www.dbcenter.cise.ufl.edu/triggerman/infoshelf/sqlt/02.toc.html#540217
http://www.dbcenter.cise.ufl.edu/triggerman/infoshelf/sqlt/02.fm2.html#104594
I hope this helps.
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
Hi Bala
I haven't used Informix for a long time, but you should be able to use:
Select * from table1 <br />
Where dtStTime between '17/01/2008' and '19/01/2008'
Informix uses environmental variables to determine the date format. From memory, DBDATE should be set to "DMY4/" for your example.
Regards
Andy
|
|
|
|
|
How to get the column name/Field name from a particular Table.
I want to list them in dropdownlist in C#
|
|
|
|
|
Ever heard of Google[^]?
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
You need to provide more detail. What kind of database are you using?
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
I am using SQL Server 2000.
|
|
|
|
|
I think you can get table characteristics by looking in the system tables. Don't quite have the info right infront of me at the moment.
---modified
Never mind, imsathy got it
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
SELECT <br />
TABLE_NAME, COLUMN_NAME, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH<br />
FROM INFORMATION_SCHEMA.COLUMNS<br />
WHERE TABLE_NAME = 'your table name'
Sathy
|
|
|
|
|
|
Its a pleasure
Sathy
|
|
|
|
|
Hi All,
We have a PDF document about 2MB.It has many web links.
We are trying to get this document into a database format with search & reporting capabilities and we want to preserve all links and text formats in the document.
We have a couple of questions:
- What database technology could we use that could run on both a CD and a web site?
- What conversion tools (and processes) would be best to use to import the content into a database?
-Can SQL Server 2000 Reporting Services help us? If so,how?
Any help/suggestions will be appreciated.Thanks.
|
|
|
|