I worked in C Sharp code works vote and found the problem appointed Data ReaderIf you will allow me in the solution
Error 25 Cannot convert method group 'Read' to non-delegate type 'bool'. Did you intend to invoke the method?
Show Erorr alsoÂ
Line 23: Con.Open ();Line 24: OleDbDataReader dr = cmd2.ExecuteReader ();Line 25: if (dr.Read)Line 26: {Line 27: label2.Text = dr (0);
codeÂ
public partial class Default2 : System.Web.UI.Page { System.Data.OleDb.OleDbConnection Con = new System.Data.OleDb.OleDbConnection (System.Web.Configuration.WebConfigurationManager.ConnectionStrings("MyConnectionString").ConnectionString); protected void Page_Load(object sender, EventArgs e)
Cannot convert type 'string' to ConstantExpression I am using the Linq to Active Directory script that is out on the net. When I do my Where clause with a pure string i manually put in "string". If I use a variable I get from a textbox (which makes sense if I am creating a search!) it will not work. I debugged and found it is having issues converting. Maybe something can be changed or maybe there is another way for me to do this?
I was unable to read any Interger8 datatype in AD. For example, "lockoutTime" in User object in the Directory. I was just always got System.Runtime type and unable to cast to any other readable type.I was also using Active Directory Explorer to see this property in the AD. I saw the property schema is defined as "Integer8".Does anyone who know how to read this data out? I was trying a lot of time and still failed.
I've been successful in creating GridView controls programically using c#. I'd like to take advantage of using the clientmode=predicatable but I can't resolve setting the ClientIDRowSuffix value. Below is a code snippet:
public void GenerateView(int fileno, string GridType, GridView dataView) { object ctrl = FindControl("pnlForm"); System.Web.UI.WebControls.Panel ctrlPanel = (System.Web.UI.WebControls.Panel)ctrl; dataView.Width = 640; dataView.ForeColor = System.Drawing.Color.Black; dataView.BackColor = System.Drawing.Color.Beige; dataView.AutoGenerateColumns = false; dataView.Caption = "<B> indicate your selection by typing Add of Delete in the Action box below</B>"; //Resulted in the following error // Cannot implicitly convert type 'string' to 'string[] // dataView.ClientIDRowSuffix = "CTR_SEQ"; // I also tried casting it // CS0030: Cannot convert type 'string' to 'string[]'...........................................
I am using c# and socket programming to create a web application. Anyone knows how to declare a useable delegate or using another method to invoke or call a method such that my codes will not have error? I am stuck for at least a week!
I am looking to convert a String (which contain my XML) to Clob type in VB.net 2005 and call a Oracle Store Procedure which return me XML in Clob type and need Convert it back to String.
Please consider below example for better reference..
Below Method Call the Oracle Procedure with String as Input
Private Function Pricing(ByVal sXML As String, ByVal strOutputXML As String, ByVal sStatus As String, ByVal sMsg As String)
Dim objParams(3) As OracleParameter objParams(0) = New OracleParameter("input_xml", OracleType.Clob, 100000) objParams(0).Direction = ParameterDirection.Input objParams(0).Value = myclob objParams(1) = New OracleParameter("output_xml", OracleType.Clob, 100000) objParams(1).Direction = ParameterDirection.Output objParams(2) = New OracleParameter("status", OracleType.VarChar, 100) objParams(2).Direction = ParameterDirection.Output objParams(3) = New OracleParameter("msg", OracleType.VarChar, 1000) objParams(3).Direction = ParameterDirection.Output ExecuteDataset(objOMARConnection, CommandType.StoredProcedure, "PRICING_INT.ITEM_PRICE", objParams)
End Function
ORACLE Procedure
PROCEDURE item_price ( input_xml IN CLOB, output_xml OUT CLOB, status OUT VARCHAR2, msg OUT VARCHAR2
I want to log all errors happened in my App to sql db. I'm passing all exception properties like (ex.Message, ex.Source, ex.StackTrace, ex.TargetSite and ex.InnerException) to stored procedure.
The problem is that when I try to pass the ex.InnerException as string to stored procedure I got this error:
Cannot implicitly convert type 'System.Exception' to 'string'
I tried ex.InnerException.ToString() and Convert.ToString (ex.InnerException) but no success.
I need to list a group of users, their group name is (IRS Group) to a list group. how to do this. I'm very new to asp.net and dont have much knowlegde about acctive directory.
I have an application where I display every Active Directory group that the current user belongs to. When I have my config setup like this:
<authentication mode="Windows"/> <authorization> <deny users="?"/> <allow users="*"/> </authorization> It works fine. When it's like this: <authentication mode="Windows"/> <authorization> <!--<deny users="?"/>--> <allow users="*"/> </authorization>
No groups are found. Why does this make a difference? Does asp.net only authenticate if we are specifically denying access to unauthenticated users? If it helps this is how i'm getting the groups:
protected string GetUserGroups() { StringBuilder userGroups = new StringBuilder(); ArrayList groupMembers = new ArrayList(); DirectoryEntry root = new DirectoryEntry("LDAP://myldap/DC=nc,DC=local"); DirectorySearcher ds = new DirectorySearcher(root); ds.Filter = String.Format("(&(samaccountname={0})(objectClass=person))", User.Identity.Name.Substring(User.Identity.Name.LastIndexOf(@"") + 1)); ds.PropertiesToLoad.Add("memberof"); try { foreach (SearchResult sr in ds.FindAll()) { foreach (string str in sr.Properties["memberof"]) { string str2 = str.Substring(str.IndexOf("=") + 1, str.IndexOf(",") - str.IndexOf("=") - 1); groupMembers.Add(str2); } } } catch { //ignore if any properties found in AD } return String.Join("|", (string[])groupMembers.ToArray(typeof(string))); }