|
Investigate using the EXPORT operation from Oracle as your backup. You will then be able to use the IMPORT operation to completely or partialy restore the database. I've been using and dependant upon these for years with Oracle on Windows servers.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
|
|
|
|
|
Hi All
I have a data of MSSQL Image filed.I have insert picture .bmp then i am getting data like this .
0x433A5C446F63756D656E747320616E642053657474696E67735C4D697274756E6A61795C4465736B746F705C756E7469746C65643131312E626D70<br />
Now i want to convert this data into Image.
Plz help me
|
|
|
|
|
You need to put the data into a stream and load your bitmap from that. SQL Server has no idea what sort of data you stored ( image just means a lump of data in this case, not a picture ).
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Thanks for reply.How to do that can you help me.That time my table have my table have column name "Image" data type "Image".Plz help me
|
|
|
|
|
Well, you would use the MemoryStream class and the Bitmap.FromStream method. It's hard to say more without knowing more about your project, but the MSDN examples and the names of the classes to use should be all that you need, anyhow.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Function LoadImage(ByVal PicSave As PictureBox) As Image
Dim arrayImage() As Byte = CType(dr.Item("DbFld"), Byte())
Dim ms As New MemoryStream(arrayImage)
LoadImage = Image.FromStream(ms)
End If
End While
dr.Close()
Return LoadImage
End Function
Best Regards,
SOFTDEV
If you have knowledge, let others light their candles at it
|
|
|
|
|
Well, I try to make people do a little research, but there's enough assumptions and problems with this code that I assume you're doing the same, so.....
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
hmm , Thats interesting , this is the reason why i put the code, can i know what problem this code has , as you know problem is the gateway to development
Best Regards,
SOFTDEV
If you have knowledge, let others light their candles at it
|
|
|
|
|
I have table data like this
Id(PrimaryKey) Time Value Time Order
1 06:00AM 1
2 07:00AM 2
3 08:00AM 3
4 09:00AM 4
5 10:00AM 5
6 11:00AM 6
If I get query like select * from table order by Time Order then I will above data
My requirement is if I have 2 customers
• Customer1 configure start time as 08:00AM then I have to bind drop down first value as 08:00AM , 09:00AM, 10:00AM, 11:00AM, 06:00AM, 07:00AM
• Customer1 configure start time as 10:00AM then I have to bind drop down first value as 10:00AM , 11:00AM, 06:00AM, 07:00AM, 08:00AM, 09:00AM
So it has basically start from ( based on configuration by customer specific) to end time then start time onwards.
Can you please how can we write SQL query above and how can I achive above requirement?
Thank,
Ashok
Ashok Nalam
|
|
|
|
|
I wouldn't write this as SQL. I would populate the list that you use in the dropdown in c#/vb.net using data from the query that you already have.
|
|
|
|
|
I need sql statement for reporting purpose also please provide the sql
Ashok Nalam
|
|
|
|
|
And what they are not using a dropdown list? What if it is needed for a report or a view?
only two letters away from being an asset
|
|
|
|
|
The initial request said "bind drop down" so I assumed that they wanted to populate a list to fill a dropdown.
|
|
|
|
|
SELECT * FROM Table
WHERE TimeOrder >= @StartOrder
UNION ALL
SELECT * FROM Table
WHERE TimeOrder < @StartOrder
only two letters away from being an asset
|
|
|
|
|
The only way to guarantee the order of a resultset is to use an ORDER BY clause;
SELECT Id, TimeValue, TimeOrder
FROM
(
SELECT Id, TimeValue, TimeOrder, 0 as result
FROM #data
WHERE TimeOrder >= @StartOrder
UNION ALL
SELECT Id, TimeValue, TimeOrder, 1
FROM #data
WHERE TimeOrder < @StartOrder
) as t
ORDER BY result ASC, TimeOrder asc
|
|
|
|
|
yes, you are right. If records are already not in order in what we need then we need to sort it as per the requirement.
|
|
|
|
|
That's not what I said. I said that the only way to guarantee the order of the results is to use an ORDER BY clause. Without the sort, the results may or may not be returned in the order that you want depending upon how the query optimizer decides to handle your request.
|
|
|
|
|
It came up again today how to handle allowing users to add custom fields to the standard entity schemas delivered in your product's database. I favour actually providing a function that gives the user limited DDL functions, so they can actually add a new, custom field to a table. Another approach is to have a separate table for custom fields, e.g. Customers, and CustomersEx, where only CustomersEx can change, but here updates become trickier than normal. The last and most badass option that we discussed was providing a EAV table, where rows are entity name, field name, field value.
Which approach is best?
|
|
|
|
|
EAVs look like a good idea but the practicalities of use (no datatyping, hard to query etc) mean that they should be avoided at all costs.
I have only ever seen this problem handled reasonably well once. They created an Entity table and an attributes table for meta data. They then generated the system and custom tables for each entity from the meta data. They then generated views for querying and stored procedures for insert, update and delete.
Views and SPs were regenerated as needed when custom attributes were added or removed. The other reason for having custom tables for each entity is that there is a limit of 8k on the total row size in Sql Server (at least prior to 2008).
|
|
|
|
|
We are currently using the EAV (what is that by the way) method with an attribute table with AttributeType and AttributeValue. Always varchar of course so yes data typing is an issue. It has allowed us to create a dynamic, extensible solution but there is a definite cost, some of the queries are just horrendous.
If I was going to go down the path RJ suggested I would have a customer table with fixed columns and a CustomerEx where the user can add custom columns and the system will rewrite the DDL. I would disallow any custom column from being in the core processing, IE reference only. I'm not sure if this is different from RJs proposal.
[edit] IJ not RJ, sorry mate [/edit]
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
I have problem, i have designed a web page in asp.net 3.5. I have a TextBox and a button, the User is expected to write some comment in the TextBox. The TextBox can also have a comment pattern including a (') on the click of button the data in the TextBox will be inserted into SQL.
Now the problem is : as you know that if u insert something in Varchar it has to be enclosed in ('), but in above case due to (') in the string itself there will be an error
So, is there a way to insert the data in SQL.
Thanks
Pankaj
|
|
|
|
|
Pankaj18 wrote: So, is there a way to insert the data in SQL.
Yup, use parameterized query's;
string commandText = "UPDATE Sales.Store SET Demographics = @demographics "
+ "WHERE CustomerID = @ID;";
using (SqlConnection connection = new SqlConnection(connectionString))
{
SqlCommand command = new SqlCommand(commandText, connection);
command.Parameters.Add("@ID", SqlDbType.Int);
command.Parameters["@ID"].Value = customerID;
command.Parameters.AddWithValue("@demographics", demoXml);
try
{
connection.Open();
Int32 rowsAffected = command.ExecuteNonQuery();
Console.WriteLine("RowsAffected: {0}", rowsAffected);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
} (Sample taken from MSDN[^])
I are Troll
|
|
|
|
|
Damn, if only I could type faster, I would have got there first.
|
|
|
|
|
Next time you'll be the first to hit the submit-button, it's a small gambling machine.
Anyway, I like it when a post gets (roughly) the same answer multiple times. Always a good sign if more than two developers agree on a solution
I are Troll
|
|
|
|
|