|
|
Thanks for the reply.I have tried that link also but its not working .Iam having both the LDF and MDF but not sure that LDF is a proper one.So i want to restore the Database only with MDF and LDF.If you know any sloutions it will be helpful for me.Please its very urgent.
|
|
|
|
|
Hello,
I'm trying to write a very simple stored procedure in Oracle, to select all the records from a table so that I can user OracleDataReader on it.
But a simple SELECT ID_person, Name FROM Names won't do it. I get a lot of compilation errors. After searching Google I found that in PL/SQL you must SELECT something INTO a variable, and that for returning a group of rows cursos should be used.
Come on, there must be an easier way! In SQL Server it's just so easy!
So, does anybody here has any ideas?
Thanks!
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
|
Thanks! I'll look in to it.
In the mean time, I found this[^], especially the section "Using DataReader".
Thanks!
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
hi everyone here in this website and who see my message.
i have two questions for you all and i hope to find someone to help me :
i installed mssql server 2000 on my pc but i use for its authentication the windows default authentication but i need to change that authentication with the username and password i want and each time i change them to the username and the password i need it tells me that authentication failed please try again or change your username what is that ????? i need to change the username and my password for entire access to my mssql server .
Miss With The Best And Die Like The Rest
|
|
|
|
|
i have a column with dataTime, if i want to select all the rows that doesn't have values typed inside that column how can i do?
i've tried with this but they are not datas compatible:
query = "select * from myTable where Date = 'null'"
|
|
|
|
|
query = "select * from myTable where Date is null"
|
|
|
|
|
I used the DTS wizard to create a DTS package transforming data from a text file into a Sql table. I have a client trying to run the package that does not have access rights to where the data source is located. The package does not give me any indication of an error, just doesn’t do the transformation. How do I handle errors in packages?
|
|
|
|
|
I have a stored procedure. in which i have both insert-select-insert command. Now the problem is that when i do the insert in table1 i want to capture a particular value from table1 so that i can use it to insert it into different table2. something like this
insert into table1 values(somevalue)
select somevalue from table1
insert into table2 value(?)
how can i fetch the value into a variable that can be used into second insert statement.
|
|
|
|
|
|
|
Hi,
there is also another way
insert into table2 (anothervalue) select anothervalue from table1
hope this will help
MarekK
|
|
|
|
|
i did the folowing query:
DateTime dtTime = DateTime.Now;
query = "SELECT * FROM myTable WHERE Data >= " + dtTime + " AND Date <= ' + dtTime2 + " OR Date = 'null'";
i need to get all the rows that has null value in the Date (dateTime) column or which time is between dtTime and dtTime2.
that query is not corrected, have i to use '', or # before and after dtTime and dtTime2?
What about?
|
|
|
|
|
Assuming that dtTime is properly converting to a value within the query that mySQL understands ( that is, that the default toString() does what you need ), and assuming that 'Data >=' is a typo above, and Date is being checked in both instances, this will only return rows where the Date column is equal to or greater than the moment when you make the query. If dtTime2 also = DateTime.Now, the odds of a match drop sharply.
Assuming this is dummy code to show the basic approach, I'd suggest you need to open a table in mySQL and see how it stores the dates, then format your datetime to be the same. It's probably YYYYMMDD:HHMMSSSS, assuming that time is also stored. The DateTime class has a property to return a string in this format, but it's name escapes me right now.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
so simply i've just to do this?
date >= dtTime.ToString()
|
|
|
|
|
my date type is a generic date type composted by:
30/11/2005 12.04.03
day/month/year hours/minutes/seconds.
i've tried to looking something insite DateTime struct, but nothing about this type.
anyway it is compoused by:
myOra.ToLongTimeString() + myOra.ToShortDateString()
how can i do?
Please help me, tnx.
|
|
|
|
|
i've tried also with this but nothing:
Data >= " + myOra.ToLocalTime().AddHours(myOra.Hour)
|
|
|
|
|
Try using parametized queries. That will make you not have to deal with date formats, and also prevent SQL injection attacks.
This is an example the the OLE DB .NET provider. You'll have to search for mySQL, but definitely possible:
string sql = "SELECT * FROM Table WHERE ID = ?";
OleDbCommand cmd = new OleDbCommand(sql, conn);
cmd.Parameters.Add("ID", id);
using(OleDbDataReader rdr = cmd.ExecuteReader()) .............. With OleDbCommand , you must supply all parameters in the order they appear in the query. In SqlCommand (for SQL Server) parameteres are named and you can supply them in any order. Check your docs for the mySQL data provider.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
|
And only if you knew that I was going to post a link to your article, but I was too lazy to go find its URL....
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
i need to delete a row by checking the ID (auto number primary key) using the following code;
query = "DELETE * FROM myTable WHERE ID = '" + id + "'";
i get an exception: data types not corresponded.
I guess it depend by the id data type, i've tried to declare it as int, uint, long, ulong but i get always the same exception.
Please help me, tnx.
|
|
|
|
|
|
|
simply id is a long numner so it donesn't need about ' '. so:
ID = id; is correct
|
|
|
|