|
Worked perfectly. Thanks Jorgen!
|
|
|
|
|
|
hi
i could not understand the "timestamp"
what is timestamp and how can i get month from timestamp
what is difference between timestamp and datatime in sql
thanks in advance
vijay kumar
|
|
|
|
|
Is a data type that exposes automatically generated, unique binary numbers within a database. timestamp is generally used as a mechanism for version-stamping table rows. The storage size is 8 bytes. The timestamp data type is just an incrementing number and does not preserve a date or a time. To record a date or time, use a datetime data type.
You're welcome
Bastard Programmer from Hell
|
|
|
|
|
Hello Everyone
I have created a WPF project (C# language) and I also have a MS Access 2007 database.
I'm trying to display the database table name in to datagrid, but i can't figur out the SQL query how to do it. The code below that I wrote it's not correct I think maybe someone can help me please and solve it...
private void Window_Loaded(object sender, RoutedEventArgs e)
{
string ConString = ConfigurationManager.ConnectionStrings["ConString"].ConnectionString;
string CmdString = string.Empty;
using (OleDbConnection myConnection = new OleDbConnection(ConString))
{
CmdString = "SELECT FoodMenu FROM MSysObjects WHERE (FoodMenu Not Like 'MSys*') AND (Type In (1,4,6)) ORDER BY FoodMenu";
OleDbCommand comm = new OleDbCommand(CmdString, myConnection);
OleDbDataAdapter sda = new OleDbDataAdapter(comm);
myConnection.Open();
DataTable dt = myConnection.GetSchema("Tables");
foreach (DataRow dataRow in dt.Rows)
{
DataGridMenuTables.Items.Add(dataRow["FoodMenu"].ToString().Trim());
}
}
}
Kind regards
Roni
|
|
|
|
|
LAPEC wrote: DataTable dt = myConnection.GetSchema("Tables");
That should work.
LAPEC wrote:
Do you mean DataSource?
LAPEC wrote: dataRow["FoodMenu"].ToString()
It's already a string, don't use ToString, just cast it ((string) dataRow["FoodMenu"]).Trim()
|
|
|
|
|
The simplest way is to create a Stored Procedure and put below mentioned SQL Query to fetch the list of tables in database.. then Bind those records to a DataGrid in C#.
SQL Query is: SELECT * FROM information_schema.tables
- Happy Coding -
Vishal Vashishta
|
|
|
|
|
I think he's using Microsoft Access, not Sql Server
Bastard Programmer from Hell
|
|
|
|
|
What is the best,simple and quick database for writing a dictionary like Babylon?
What database system Babylon use?
|
|
|
|
|
davood_b wrote: What database system Babylon use?
I don't even know what that is.
davood_b wrote: for writing a dictionary like Babylon?
Ditto.
davood_b wrote: What is the best,simple and quick database
SQL Server Express.
|
|
|
|
|
..and install a server-class database-application, for a simple local data lookup?
Bastard Programmer from Hell
|
|
|
|
|
Eddy Vluggen wrote: a simple local data lookup
I have no idea that that's the case.
|
|
|
|
|
davood_b wrote: What is the best
There ain't no such thing.
davood_b wrote: simple
Any SQL92-compliant database.
davood_b wrote: database for writing a dictionary like Babylon?
A local file-based database, like SqlCe, Sqlite or MSAccess.
davood_b wrote: What database system Babylon use?
Dunno, ask them. Ergane is using MSAccess, and you can download those dictionaries for free. Translates using Esperanto as an intermediate language (English -> Dutch would be English -> Esperanto -> Dutch). I don't have a download-link, you'll have to Google yourself.
Bastard Programmer from Hell
|
|
|
|
|
Hi, Just would like to ask for help for the xquery that I need to use for the xml string below to populate my table with the following dimension. This means that for each manager, I can have more than 1 row (depending on the number of staff) as I have flattened the table to eliminate joins on multiple table vars. Sorry, I just couldn't get my xquery right.
Finally, if I have my xsd, how do I validate an xml input such as above with sql?
Many thanks.
Manager Name Type Staff
declare @myOrg xml
set @myOrg = '="1.0"="utf-8"
<Department>
<Subdivision>
<Managers>
<Manager>
<Name>Martin</Name>
<Type>Full Time</Type>
<Purpose>Subdivision 1 Shadow</Purpose>
<Description>Project Management, Operations</Description>
<FullName>Martin Fuller</FullName>
<StaffList>
<Staff>H1 Level 4, 345Y</Staff>
<Staff>H1 Level 4, DS23</Staff>
</StaffList>
</Manager>
<Manager>
<Name></Name>
<Type></Type>
<Purpose></Purpose>
<Description></Description>
<FullName></FullName>
<StaffList>
<Staff></Staff>
</StaffList>
</Manager>
</Managers>
</Subdivision>
</Department>'
----------------------------------------------------------
Lorem ipsum dolor sit amet.
|
|
|
|
|
Hi,
How can i read SQL Database 2008 LDF (Log) file programmatically (<code><big>with T-SQL OR C#</big> ).
Its very Important for me.
Plz Help
|
|
|
|
|
The format isn't publicly available. Why do you need them?
Bastard Programmer from Hell
|
|
|
|
|
I wanna to check the action placed on the database at different times and dates.(when insert occured in tblName or what palce for data in Update Statement OR ...)
|
|
|
|
|
If you want to read the log file, you'll have to contact Microsoft for a license.
What you want could be easily achieved using a trace, logging it's results. To a textfile or some other database. Google for "Sql Trace" and you should find some interesting results, even from CodeProject
Bastard Programmer from Hell
|
|
|
|
|
thanks for solution.
but it wont give me that when and what for example insert/Delete/Update/Select in/from tblName.
I wanna something log like this.
|
|
|
|
|
To do this you need to implement an AUDITING strategy, this generally involves triggers (spit) and an audit table. Do some research on database Auditing.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Mycroft Holmes wrote: this generally involves triggers
Cool suggestion
Bastard Programmer from Hell
|
|
|
|
|
jojoba2011 wrote: but it wont give me that when and what for example
When, what, and even who are included.
Bastard Programmer from Hell
|
|
|
|
|
Really thanks for all your Solutions!
but i have sqlexpress and this feature isnot active in Express 2008!
What can i do then?
|
|
|
|
|
Creating a trace is also possible for Sql Express.
Google Harder
Bastard Programmer from Hell
|
|
|
|
|
Hi,
but trace can only catch the Error not the work i wanna.
|
|
|
|