BC30452: Operator '&' is not defined for types 'String' and 'System.Web.UI.WebControls.AccessDataSource'.

hi everyone,

i keep getting the error page...

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30452: Operator '&' is not defined for types 'String' and 'System.Web.UI.WebControls.AccessDataSource'.

Source Error:

Line 20: 
Line 21: cmdSelect = New Data.OleDb.OleDbCommand(strSelect, conMaterials)
Line 22: cmdSelect.Parameters.Add("@grad_attribute_name", "%" & gradatt_search & "%")
Line 23: cmdSelect.Parameters.Add("@grad_element_name", "%" & gradele_search & "%")
Line 24: cmdSelect.Parameters.Add("@discipline_name", "%" & discipline_search & "%")

ive search around the net but cant find any answers. im a relative newbie to asp and ado and really don't even know what the msg is telling me.

here is the rest of my code if it helps.

<%@Import Namespace = "System.Data.OleDb" %>
<script runat="server">

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim conMaterials As Data.OleDb.OleDbConnection
        Dim strSelect As String
        Dim cmdSelect As Data.OleDb.OleDbCommand
        conMaterials = New Data.OleDb.OleDbConnection("Provider = Microsoft.Jet.OleDb.4.0; DATA Source = c:\Documents and Settings\Matt\Desktop\ACUMEN1\ACUMEN.mdb")
        strSelect = "SELECT * FROM materials WHERE " & _
              "grad_attribute_name IS LIKE @grad_attribute_name AND " & _
              "grad_element_name IS LIKE @grad_element_name AND " & _
              "discipline_name IS LIKE @discipline_search AND " & _
              "resource_name IS LIKE @resource_search'"

        cmdSelect = New Data.OleDb.OleDbCommand(strSelect, conMaterials)
        cmdSelect.Parameters.Add("@grad_attribute_name", "%" & gradatt_search & "%")
        cmdSelect.Parameters.Add("@grad_element_name", "%" & gradele_search & "%")
        cmdSelect.Parameters.Add("@discipline_name", "%" & discipline_search & "%")
        cmdSelect.Parameters.Add("@resource_name", "%" & resource_search & "%")




10/14/2006 4:31:04 AM
asp.net.object-datasource 16182 articles. 0 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 32

What is gradatt_search ?

Is it a Webcontrol? -> Should be gradatt_search.text


should be (as far as i know!)



10/14/2006 9:56:18 AM

Similar Artilces:

Operator '&' is not defined for types 'String' and 'System.Web.UI.WebControls.TextBox'
Can anyone tell me what this error message means, and what to do to correct it.  Here is the code that has the error:  Dim sql As Stringsql = "INSERT INTO tblConnecting (Date, Member, Name, Company, Phone, Fax, Address, NamesofAttendees, PaymentType, Email) " _ & "Values('" & Today() & "', '" & blnMember & "', '" & Me.txtName.Text & "', '" & Me.txtCompany.Text & "', '" _& Me.txtPhone.Text & "', '" & Me.txtFax.Text &...

Error 60 Operator '&' is not defined for types 'System.Web.UI.WebControls.TextBox' and 'String'.
The comment control is a textbox:<td align="right" style="width: 228px"><asp:TextBox ID="comment" runat="server" TextMode="multiLine" Rows="10" Columns="50" onkeyup="return ismaxlength(this)" Width="260px" Height="100px" Font-Overline="false" /></td> and I'm being told by VS (underlined in blue ) that the for the comment field: Error 60 Operator '&' is not defined for types 'System.Web.UI.WebControls.TextBox' and 'String...

BC30452: Operator '&' is not defined for types 'String' and 'System.IO.Stream'.
I try to upload an file into an image-field in my SQL but I get this error: BC30452: Operator '&' is not defined for types 'String' and 'System.IO.Stream'. What is this error and how can I solve it? Piece of the code:Dim MyFileCollection As HttpFileCollectionDim MyFile As HttpPostedFileDim FileLen, Loop1 As IntegerDim bijlage As Stringbijlage = ""Dim MyStream As System.IO.StreamDim ContentType As StringMyFileCollection = Request.FilesMyFile = MyFileCollection(0)ContentType = MyFile.ContentTypeFileLen = MyFile.ContentLengthDim Input(FileLen) As ByteMyStream = MyFile.InputStreamA...

Name: haznen Email: haznenatyahoodotcom Product: Gran Paradiso Alpha 8 Summary: '''''''''''''''''''' Comments: '''''''''''''''''''''''''''''''''''' Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20061204 UGES/ GranParadiso/3.0a1 From URL: http://www.mozilla.org/projects/granparadiso/ Note to readers: Hendrix gives...

Cast from type ''''DBNull'''' to type ''''String'''' is not valid.
How do I avoid getting this error: Cast from type ''''DBNull'''' to type ''''String'''' is not valid. I am trying to get values from the database into a form for updating using a Datareader, SQL is set to allow nulls for certain fields as they are not required but the only way I can get the form to display is by adding a space in SQL. Is there another way around this? Check if it is equal to DBNull.Value first and if it is, don't do the cast.Stanley Tan theSpoke Blog Where in the code does it need to go? I am using the following and it's the profile that isn't always requi...

Name: mario Email: ramar17atfastwebnetdotit Product: Gran Paradiso Alpha 2 Summary: ''''' Comments: K: Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a2) Gecko/20070206 GranParadiso/3.0a2 ...

Unable to cast object of type 'System.Web.UI.WebControls.FormView' to type 'System.Web.UI.WebControls.DropDownList'.
Hi,  I have a formview with a dropdownlist created dynamically. i want to determine whether the dropdownlist was clicked. the code is written in the FormView1_DataBound method. I get the following error in the line below that is in italics and underlined: Unable to cast object of type 'System.Web.UI.WebControls.FormView' to type 'System.Web.UI.WebControls.DropDownList'.   Here is my code: ddl_iFullname = New DropDownList ddl_iFullname.ID = "ddl_iFullname" ddl_iFullname.DataSource = ObjectDataSource3 ddl_iFullname.DataTextField = "fullname" ddl_iFullname.DataValueField = "...

Unable to cast object of type 'System.Web.UI.WebControls.Label' to type 'System.Web.UI.WebControls.TextBox'
I am attempting to "Update" a field in a Datagrid, but no matter what I do (Using either Label or Text Boxes)  I keep getting the same error: Unable to cast object of type 'System.Web.UI.WebControls.Label' to type 'System.Web.UI.WebControls.TextBox' The Error is highlighted below in the Sub... <==THE FIELD THAT CALLS THE ERROR  Any help would be greatly appreciated !!! Thanks !!   The code is as follows... <table border=0 height=210 bordercolor=olive ><tr valign=top><td> <asp:datagrid id="FacilityDataGrid" runat="server" Font-Names="Arial" Font-Size="11px" HorizontalAlign="Left" ItemStyle-Font-Size="x-small" HeaderStyle-Font-Bold="True"HeaderStyle-Font-Size="x-small" AlternatingItemStyle-BackColor="#FFFFFF" Cellpadding="0" BorderWidth="0"AutoGenerateColumns="False" BorderStyle="None" GridLines="None" BorderColor="#404040" Width="75%"DataKeyField="FacilityID"OnUpdateCommand="MyDataGrid_UpdateCommand"OnCancelCommand="MyDataGrid_CancelCommand"OnEditCommand="DG_Combo_Edit"> <AlternatingItemStyle BackColor="#FFFFFF"></AlternatingItemStyle><ItemStyle Font-Size="X-Small"></ItemStyle><HeaderStyle Font-Size="X-Small" Font-Bold="True" ForeCo...

Unable to cast object of type 'System.String' to type 'System.Web.UI.WebControls.Parameter'.
I'm getting this error on a vb.net page the needs to execute two separate stored procedures.  The first one, is the main insert, and returns the identity value for the ClientID.  The second stored procedure inserts data, but needs to insert the ClientID returned in the first stored procedure.  What am I doing wrong with including the identity value "ClientID" in the second stored procedure?  Unable to cast object of type 'System.String' to type 'System.Web.UI.WebControls.Parameter'. Description: An unhandled exception occurred during t...

BC30452: Operator '&' is not defined for types 'String' and '1-dimensional array of Byte'.
Can anyone help with this error? I am trying to insert information into my database but when I execute my page, I receive BC30452: Operator '&' is not defined for types 'String' and '1-dimensional array of Byte'. Here is my insert statement: strInsert = "Insert into Product(Artist_Name,Genre,Label,Other,Display_Preference,Album_Name,Album_Year,Song_Title,Filetype,File_Access) Values ('"& txtArtist.text & "', '" & dropGenre2.SelectedItem.Text &"', '"& dropLabel.SelectedItem.text &"', '"& txtOther.text &a...

BC30452: Operator '&' is not defined for types 'String' and '1-dimensional array of Byte'.
hi I am writing a byte() into sql server 2005 ======================= here is table properties ======================= ORIGINAL - varchar(50) HASH - varchar(50) BINARY_VALUE - binary(100) =======================   here is the code where i have an error. some codes....  Dim data As Byte() = md5Hasher.ComputeHash(Encoding.Default.GetBytes(input))  some codes..... *******The first line has the error. ******** strSQL = "INSERT INTO AAA_MD5 (ORIGINAL,HASH,BINARY_VALUE) VALUES('" & szPlain.Text & "','" & szMD5.Text &...

Unable to cast object of type 'System.Web.UI.LiteralControl' to type 'System.Web.UI.WebControls.TextBox'.
Hi, any idea why I'm getting the following error?Line 45: protected void CartGrid_RowUpdating(object sender, System.Web.UI.WebControls.GridViewUpdateEventArgs e) Line 46: { Line 47: TextBox QuantityTextBox = (TextBox)CartGrid.Rows[e.RowIndex].Cells[2].Controls[0]; Line 48: int Quantity = Convert.ToInt32(QuantityTextBox.Text); Line 49: Are you sure that the control at CartGrid.Rows[e.RowIndex].Cells[2].Controls[0] isn't a LiteralControl?  How are you creating code this in your code?Brent JenkinsASP.NET, C#, Web Developerwww.valewebdesign.co.uk  ...

Unable to cast object of type 'System.Web.UI.LiteralControl' to type 'System.Web.UI.WebControls.TextBox'
Hello, Goal: enter a number in two fields HoursPerUnit and PeoplePerUnit and the value for the third field, TotalHoursPerUnit will populate after the the number in the two fields have been caculated.  Using the code below I receive the error message above.  Please tell me what am I doing wrong? Do I need to cast the text as a literal?  Please help? Thank you in advance, <%@ Page Language="VB" MasterPageFile="Default.master" AutoEventWireup="false" CodeFile="frmHR.aspx.vb" Inherits="frmHR"...

table_info('','','','%') cannot return any types
I was recently confirming table_info special cases and discovered the case for getting table_types cannot work. table_info('','','','%') should return a list of table types but it returns a list of empty strings instead: my @types = $h->tables('', '', '', '%'); print "all types:\n", join("xxx\n", @types), "\n"; # should output something like: # "dbo" # "INFORMATION_SCHEMA" # "sys" # and actually outputs: xxx xxx It seems to be down to the following ...

Unable to cast object of type 'System.EventArgs' to type 'System.Web.UI.WebControls.GridViewRowEventArgs'
hi this is really really bugging me please help. I have a web appliction that uses a Master Page. On one of the content pages I am presenting a gridview control bound to a spreadsheet. The gridview is contained within an ajax update panel. I want to add attributes to the rows of the gridview control once databound (mouseover effect). However I am getting the following error:- Unable to cast object of type 'System.EventArgs' to type 'System.Web.UI.WebControls.GridViewRowEventArgs' Can anyone help please. Here is the aspx code:-  <%@ Page Language="v...

Unable to cast object of type 'System.Int32' to type 'System.Web.UI.WebControls.DataKey'
hi , i have a datalist with an itemtemplate section that contains an image and a delete button to delete the corresponding image . <asp:DataList ID="DataList1" CellSpacing="25" runat="server" DataSourceID="sqldatasource3" DataKeyField="ID" repeatColumns="4" repeatdirection="Horizontal" BackColor="White" BorderColor="#999999" BorderStyle="None" BorderWidth="0px" CellPadding="3" > <ItemTemplate> <table border="0" cellpadding="0" cellspacing="0" > <tr> <a href='<%# DataBinder.Eval(Container.DataItem, "image", "ImageViewer.aspx?id={0}") %>' > <img a...

Operator '*' is not defined for type 'DBNull' and type 'Decimal'.
 I am getting an error from the following line   <asp:Label ID="Label1" runat="server" Text='<%# String.Format("{0:C}", Eval("ProductQty") * Eval("Price"))   %>' ></asp:Label> I think I may need to convert/define the Variables but not quite sure how to do it. Any help would be great. it's not a matter of converting...its the fact that the value from the DB is Null... You'll have to wrap an IF check around it or change your query to return 0 instead of Null. If the field ...

Operator '==' cannot be applied to operands of type 'string[]' and 'string'
Hi, I have the following C# code and the line - " if(a == "Document Library") break; " - is giving me the error - Operator '==' cannot be applied to operands of type 'string[]' and 'string' I am not very familar with c# and would appreciate any help as to how to get around this. I have checked google but can't see anything covering this. Cheers for all help... string [] a; try { currentFolder = currentFolder.Replace("%2f","/"); currentFolder = currentFolder.Replace("%20"," "); a = curre...

Operator '=' is not defined for type 'Char' and type 'Boolean'.
Hello, In my application when i click the button i'm getting this " Operator '=' is not defined for type 'Char' and type 'Boolean'. " But when i test it locally there is no problem at all!!!! Please tell me why this error is occuring...Thanks SwapnaPlease click "mark as answer" if this post helped you. swapnasamsonvarkey: Hello, In my application when i click the button i'm getting this " Operator '=' is not defined for type 'Char' and type 'Boolean'. " But when i test it lo...

Error Serializing Value 'System.Web.UI.WebCOntrols.TreeNode' of type 'System.Web.UI.WebCOntrols.TreeNode'
Hi, I am  getting the error stated in the subject when i am storing a TreeNode in a ViewState and then using it as follows if (ViewState["ProductCounty"]!=null) { TreeNode _productCountyNode = DataTree.FindNode(((TreeNode)ViewState["ProductCounty"]).ValuePath); _productCountyNode.Expand(); } what could be causing this error? Hi, I believe TreeNode isn't serializable in a way its required for objects which can be put to ViewState - as reference - (TreeNode implements IStateManager and is meant to work together with TreeView itself saving it...

Operator '&&' cannot be applied to operands of type 'bool' ... 'string'"
Hi friends .I get the following error for this line of code "if (QSDealID = (dr.GetString(1) && ((tt.TotalSeconds)<= 15) && (ip) = dr.GetString(4)))"  error:Operator '&&' cannot be applied to operands of type 'bool' ... 'string'" I need ur urgent help...Gurjeet,England Hi There, Im not 100% know what variable you have here, but i guess this is what you trying to do: if ( (QSDealID == dr.GetString(1)) && ( tt.TotalSeconds <= 15) && (ip == dr.GetString(4)) ) Equal operand in C# is == NOT = Hope...

Error showing up: Unable to cast object of type 'System.Web.UI.WebControls.TextBox' to type 'System.IConvertible'.
Hi, I am trying to pass date values from two textboxes in a stored procedure from ASP.net page. However, it seems it is not passing the date properly. I am getting the following error at the following line: cmd_r.Parameters("@initial_est_date").Value = Convert.ToDateTime(Textbox1)  and the error is as stated in the title. I would appreciate any help to resolve this. Thanks  CODE:<%@ Import Namespace="System.Data" %> <%@ Import Namespace="System.Data.SqlClient" %><%@ Import Namespace="System.Data.Common" %> <%@ I...

Operator 'And' is not defined for types 'System.Web.HttpCookie'?
I have declared 2 variables as HttpCookie objects. Im trying to check if both are non-existent but I get an error when I use the "AND" operator. here is the code in reference: -- Dim objcookie As HttpCookie objcookie = Request.Cookies("ckusername") Dim objckuserid As HttpCookie objckuserid = Request.Cookies("ckuserid") If objcookie AND objckuserid Is Nothing Then <------------------- -- I get this error when I execute the page: Compiler Error Message: BC30452: Operator 'And' is not defined for types 'System.Web.HttpCookie'...

Error: Cannot convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.ButtonField'
Hello, I am getting the following error during compiliation. Any suggestions to fix it. Thanks. Cannot convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.ButtonField' protected void gvEvents_RowCommand(Object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Select") { int index = Convert.ToInt32(e.CommandArgument); GridViewRow selectedRow = gvEvents.Rows[index]; string sID; ButtonField btn; if (selectedRow.RowType == DataControlRowType.DataRow) { sID = ((ButtonField)selectedRow.FindControl("ID")).DataTextFi...

Web resources about - BC30452: Operator '&' is not defined for types 'String' and 'System.Web.UI.WebControls.AccessDataSource'. - asp.net.object-datasource

Resources last updated: 2/16/2016 3:29:16 PM