DataSource Controls :: What Is The Similar Syntax For TYPE In Oracle
Jun 17, 2010
May I know in SQL Server, what is the similar syntax for %TYPE in Oracle, i.e. the variable defined will follow the data type defined in the database column?
I'm doing a transaction type that is similar to iBank where people can add their payee. In my SQL database, I have a transaction table which has the date variable. I would like to set in a way that if the user did not express interests to activate the payee, the record will be expired after 1hour.
I would like to monitor all the queries running under Oracle which are being fired. Looking for some good UI tool for Oracle similar to Microsoft SQL Server Profiler.
I have a textbox and what I would like to implement is basically a situation similar to what you have in google when you type in a word. In otherwords,
in the textbox when you type in J, it should generate a list of names that starts with O in alphabetical order, then next when you type in o, so that now you have Jo, it should generate a list of names instead that now starts with Jo in alphabetical order, then again when you type in h, it should generate a list of names that starts with Joh and so on.
I have this error "The given value of type String from the data source cannot be converted to type datetime of the specified target column." when I used sqlbulkcopy to do the transaction
I get the error - Conversion from type 'DBNull' to type 'Integer' is not valid. - on the line.....
Dim newid As Integer = e.Command.Parameters("@latestRowId").Value.........in vb code behind.
I have the identical code for another page with the exception of the field names and it works fine. The only thing I did differently, as far as I know, is I copied the asp and code behind from the page that works into this page and manually changed the field and table names. I don't know what the problem is. Does anyone see any problems?
I have an Interface that has its concrete class defined via a factory. Because of this I found no way to use the Interface tpye directly in my LINQ quesry so I had to use the concrete class types to creat a generic list. The LINQ query works but after calling.ToList() on the LINQ query result I get a List(of MyConcreteClass), but I need a List(of IMyConcreteClass). I have tried everything I can find: .Cast, Ctype, implicit casting, etc. but I always get back one of the (2) messages (depending on if I attempt to cast)message:
"Unable to cast object of type 'System.Collections.Generic.List`1[MyConcreteClass]' to type 'System.Collections.Generic.IEnumerable`1[IMyConcreteClass]'." ...or "Unable to cast object of type '<CastIterator>d__aa`1[IMyConcreteClass]' to type 'System.Collections.Generic.List`1[MyConcreteClass]'."
I am making a website to store invoices so i can mail them to clients. So i got a table for clients, invoices and one with invoice products/services. When an invoice has no products/services added to them and it returns null i get the error "the null value cannot be assigned to a member with type System.Decimal which is a non-nullable value type."
I just started with linq. Before i always used mysql. Mostly i just had to call data from 1 table so forgive me if my linq query isn't really correct.
Dim invoices = From i In db.invoices _ Group Join p In db.products On i.id Equals p.invoiceId Into invoiceProducts = Group _ Select New With {i.client.naam, i.titel, (From iP In invoiceProducts Select iP.prijs).Sum}
i show the client's name, the title of the invoice and the total amount the clients will need to pay for products and services.
We are working in a new N-Layered application with EF4 as ORM. As a requirement, we need to give support for both SQL Server and Oracle existing databases.
Our wish was to build a single EDMX model and then generate our business entities from a TT file.
The main problem was that database providers may generate different .NET types from our database field types. In this case, we'll have different EDMX models and then different auto-generated entities, which is more or less the same as have two different applications.
I don't know if we could have different SSDL files with specific database information (one for Oracle and another one for SQL Server) in separete files and share CDSL and MSL information for both databases.
Would be this solution possible?
Someone knows some other way to work with Oracle and SQL Server using EF4?
Dim connStr As String = " Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=W:PatioOrderApp_DataPatio.mdb" Dim con As New OleDb.OleDbConnection(connStr) Dim instr As String = " INSERT INTO tOrders([first_name],[last_name],[order],[comment]) Valuse(?,?,?,?)" If IsValid Then Using con Using cmd As New OleDb.OleDbCommand(instr, con) cmd.CommandType = CommandType.Text cmd.Parameters.AddWithValue("first_name", DBNull.Value) cmd.Parameters.AddWithValue("last_name", DBNull.Value) cmd.Parameters.AddWithValue("order", DBNull.Value) cmd.Parameters.AddWithValue("comment", menuDrinks.SelectedItem.ToString) con.Open() cmd.ExecuteNonQuery() End Using End Using con.Close() End If
I have this Insert statement working fine: [Code]....
It inserts a new record into a single table. The PK is a field named QID.what the equivalent Update code would be? I'm not sure of the syntax for the Update values (old and new) and Where clause.I'm assuming something beginning with: existingQ.Update
here is my update query syntax.my problem is.if i update only logo1 and logo3 with null logo2 and img null then my query should be update the other record.just dont update null value record but other should be update.but below my query can not update any record.
UPDATE tbitem set itemname= @itemname,note=@note, price=@price,qty=@qty,logo1=@logo1, logo2=@logo2,logo3=@logo3,img=@img where id =@id and @logo1 is null and @logo2 is null and @logo3 is null and @img is null
I hv Writte nA sql Query in whic hi want to use an Inner join as well as THe left OUter Join in it ..i hv written it in the sql server it executes properly.but when i run the same code ..from my application .it starts gving the Error Incorrect Syntax Near Keyword INNER..
working with sql server 2005/ visual studio 2005 asp.net c# i just wanted to know ... to insert a date to the database in a field that gets "dateTime" i need to insert the origin syntax. what is the right syntax for the datetime in the database? and to invent for users to insert a wrong sytax ... wich validations i need to put on the field? same question on the type "image" in database it gets like a jpg file? how do i insert an image to the database? If i have a textbox that contain a number ... and i want to ask somthing about the number. how do i do it ? .... like i now that i need to convert it to int i tried this way but it didnt work:
I am just not able to get the syntax right for the below code,
Dim HeaderCount As Integer = readerXML.HeaderCount() Dim NewTable As String NewTable = "CREATE TABLE " + tbCustomerFileName.Text + " (" + " RowId smallint" + " IDENTITY(1,1)" + " PRIMARY KEY CLUSTERED," For I = 0 To [HeaderCount] NewTable = NewTable + readerXML.Item(I) + " DEFAULT 'New Position - title not formalized yet'," + " varchar(50) NOT NULL," Next [I] + ")" ...this part gives me an error ssaying incorrect syntax.
I am trying to upload an excel file and based on the number of headers in the file, I want to generate columns, however I am just not able to get this going because i am getting syntax error, the main problem being I am not able to put the brackets at the right place.
Incorrect syntax near '>'. I made a listview with some dropdownmenu and selectboxes to select from untill the query shows in the listview.
Now the query goes well and shows the first page of 4 rows as I wanted it.
The pager shows 5 pages and if I a want to click on the next page I get this message.
Incorrect syntax near '>'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Incorrect syntax near '>'.
<asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="<%$ ConnectionStrings:AvcilarEvleri %>" SelectCommand="SELECT * FROM Tabel1 WHERE ((([Regio_Object] = @Regio_Object) AND ([Plaats_Object] = @Plaats_Object) AND ([Wijk_Object] = @Wijk_Object) AND (Prijsklasse => @Prijsklasse1) AND (Prijsklasse <= @Prijsklasse2) AND (Prijsklasse => @Prijsklasse3) AND (Prijsklasse <= @Prijsklasse4 AND (Oppervlakte_Object => @Oppervlakte_Object1) AND (Oppervlakte_Object <= @Oppervlakte_Object2)) AND ((Type_Object = @Type_Object1) OR (Type_Object = @Type_Object2) OR (Type_Object = @Type_Object3)))"> <SelectParameters> <asp:ControlParameter ControlID="DropSehir1" Name="Regio_Object" PropertyName="SelectedValue" Type="String" /> <asp:ControlParameter ControlID="DropIl1" Name="Plaats_Object" PropertyName="SelectedValue" Type="String" /> <asp:ControlParameter ControlID="DropDownList5" Name="Wijk_Object" PropertyName="SelectedValue" Type="String" /> <asp:ControlParameter ControlID="DropFiyat1" Name="Prijsklasse1" PropertyName="SelectedValue" Type="String" /> <asp:ControlParameter ControlID="DropFiyat2" Name="Prijsklasse2" PropertyName="SelectedValue" Type="String" /> <asp:ControlParameter ControlID="DropFiyat3" Name="Prijsklasse3" PropertyName="SelectedValue" Type="String" /> <asp:ControlParameter ControlID="DropFiyat4" Name="Prijsklasse4" PropertyName="SelectedValue" Type="String" /> <asp:ControlParameter ControlID="DropMetre1" Name="Oppervlakte_Object1" PropertyName="SelectedValue" Type="String" /> <asp:ControlParameter ControlID="DropMetre2" Name="Oppervlakte_Object2" PropertyName="SelectedValue" Type="String" /> <asp:ControlParameter ControlID="CheckBoxList1" Name="Type_Object1" PropertyName="SelectedValue" /> <asp:ControlParameter ControlID="CheckBoxList1" Name="Type_Object2" PropertyName="SelectedValue" /> <asp:ControlParameter ControlID="CheckBoxList1" Name="Type_Object3" PropertyName="SelectedValue" /> </SelectParameters> </asp:SqlDataSource>
And the code;
Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
Panel1.Visible = False Panel4.Visible = False Panel5.Visible = False Panel6.Visible = False Panel7.Visible = False Panel8.Visible = False Panel9.Visible = False Panel10.Visible = False Panel2.Visible = True Panel3.Visible = True Dim strchklist As String = "" Dim li As ListItem For Each li In CheckBoxList1.Items If li.Selected Then strchklist += ",'" & li.Value & "'" End If Next If strchklist = "" Then Response.Write("No item Selected") End If SqlDataSource4.SelectCommand = "SELECT * FROM Tabel1 WHERE ([Regio_Object] = @Regio_Object) AND (Plaats_Object = @Plaats_Object) AND (Wijk_Object = @Wijk_Object) AND (Prijsklasse >= @Prijsklasse3) AND (Prijsklasse <= @Prijsklasse4) AND (Oppervlakte_Object >= @Oppervlakte_Object1) AND (Oppervlakte_Object <= @Oppervlakte_Object2) AND Kamers_Object IN (" & strchklist.Substring(1) & ")" SqlDataSource4.DataBind() End Sub
I am sure it has something to do with the query because and with the checkboxes.
I'm using the following code to select a number of fields from a Table, this works perfectly, however I actually want to select from a stored procedure not a table and im not sure what the correct syntax is,
I have a problem with my SQL statement that only needs to show future dates in the Gridview.I use vb, vs 2005.I want a DateTime Field(TEndDate) to act as a control field in that only future dates (WHERE TEndDate >= Now.Date.Date) should be returned.It asks for my paramaterized value when I'm building the query.I'm unsure about the source I should select for the query.(The options are: None/Control/Cookie/Form/Profile/Querystring/Session)I'm losing my mind with this!Here is my code:
Where can I find documentation on the syntax that is expected for LinqDataSource.Select? It seems to be different from what I would do with Linq inline in C# code. For example, concatenateing something in Linq I would normally just do this in the projection:
new { FullName = (person.FirstName + " " + person.LastName ) } However, with a LinqDataSource the only way I've found to do this is like this: new ( String.Concat(person.FirstName, " ", person.LastName) as FullName)
I literally spent hours trying to figure this out, and only succeeded when I found a blog where someone gave this verbatim as an example. So I still don't understand why the syntax is different, the braces versus parens, aliasing, Concat operators. Next time I do this I want a better understanding so I am not playing this guessing game. It's like being handed a compiler, and trying to write a program when you don't know what language the compiler compiles.1. Are there different "flavors" of Linq? Like a VB Linq, and C# Linq?2. If so, is the LinqDataSource using a VB flavor of Linq?3. Really, what is really important to me, where can I find documentation on this particular falvor of Linq that the LinqDataSource expects? The documentation for the LinqDataSource itself gives nothing more than extremely simplistic examples.
I have a website in which code on the production server runs no problem. The same code on my local machine or test server produces the mess seen at the end. The exact same code. Additionally, upon trying to preview any of the table adapters in the dataset I get "DataSet1.thename could not be previewed. The provider is not compatible with the version of Oracle client"
The app is SQL Server. It always has been. It has never used Oracle. Does anyone have any insight on how to fix this? As it is now I can't do anything with my dataset. I can't edit anything in there because of this complaint about Oracle.