
jeffchs
Members-
Posts
17 -
Joined
-
Last visited
jeffchs's Achievements
Newbie (1/14)
0
Reputation
-
I have spent a lot of time researching this and have not had much luck. I am trying to add a feature to one of my companies web applications to automatically add a task to a user in the exchange server. Then the task will appear in their outlook, webmail etc. I have been looking around for examples of this and have not had much luck. I already have the Exchange SDK. Most of the examples I have found are cryptic and incomplete. From what I have found, it would appear the best way to do this operatin would be using ADODB. I was wondering if any one knew of any complete examples outlining what would be involved in this or a similar operation. As of right now I'm kind of lost.
-
This is code I used in a C# web app in .NET. You should be able to place this code in the Page_Load function using the correct identifier for your button. yourButtonBtn.Attributes.Add("onclick", "return confirm('Are you sure you want to do this?')");
-
I am an idiot. You rule. Thanks for your help.
-
her is the code I have at the moment. there are a lot string function calls in it right now because I'm trying to find out what works and what doesn't so I can better locate the source of the problem. public void Search(object o, EventArgs e) { string sqlSearch = "SELECT * FROM myTable WHERE "; string sqlSubject = ""; string sqlDescription = ""; foreach(string term in txtSearchTerms.Text.Split(new char[] {' '})) { sqlSubject += "subject LIKE '%" + term + "%' AND "; } char[] trimAnd = {'A','N','D',' '}; sqlSubject.TrimEnd(new char[] {'A','N','D',' '}); sqlSubject.Trim(trimAnd); sqlSubject.Replace("AND ", "and"); sqlSubject.ToLower(); foreach(string term in txtSearchTerms.Text.Split(new char[] {' '})) { sqlDescription += "description LIKE '%" + term + "%' AND "; } sqlSearch += sqlSubject + " OR " + sqlDescription; Response.Write(sqlSearch); } here is the sqlSearch string I get from the response.write when i use "hi hello" as the search string. SELECT * FROM myTable WHERE subject LIKE '%hi%' AND subject LIKE '%hello%' AND OR description LIKE '%hi%' AND description LIKE '%hello%' AND The TrimEnd should remove the "AND " in the "AND OR", the Trim should actually remove all the instances of "AND ", the replace should change all instances of "AND" to "and", my final desperate attempt was to see if they could all be chaned to lowercase, just to test. as you can see, none of them work. This is a reallly strange problem to have. Thanks for looking at this.
-
Well, the error from the character array has dissappeared. yes dissappeared. I didn't change anything, it just went away. however, the trim functions still do not work. I can think of several work arounds for this particular problem, but I would really like to use the trim functions as they are the easiest and should work. any ideas?
-
I don't think it is possible since the code is only on the server side. maybe adding a runat="server" attribute in the button would work, but I doubt it. you could have the button repost to the same page with a modified URL adding a ?myvariable=myvar then have your page load function check for this variable and call the function from the pageload.
-
I have a function for dynamically building a SQL string. when I am finished building this string I need to trim the last "AND " off of the end of it. I can't get any of the string functions to work on this string. I can't even trim the white space off the end. Aside from those problems, I get a strange error when defining a character array for my trim characters. When I use: char[] trimAnd = {'A','N','D',' '}; I get: Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Parser Error Message: Could not load type $$struct0x6000002-1 from assembly myAssembly, Version=1.0.1451.16708, Culture=neutral, PublicKeyToken=null because the format is invalid. Source Error: Line 256: <add assembly="System.EnterpriseServices, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/> Line 257: <add assembly="System.Web.Mobile, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/> Line 258: <add assembly="*"/> Line 259: </assemblies> Line 260: Source File: c:\windows\microsoft.net\framework\v1.1.4322\Config\machine.config Line: 258 I actually get this error for an array of any characters over 2 characters in length. This error occurs on both my testing server and my live server. here is my whole function: public void Search(object o, EventArgs e) { string sqlSearch = "SELECT * FROM myTable WHERE "; string sqlSubject = ""; string sqlDescription = ""; foreach(string term in txtSearchTerms.Text.Split(new char[] {' '})) { sqlSubject += "subject LIKE '%" + term + "%' AND "; } char[] trimAnd = {'A','N','D',' '}; foreach(string term in txtSearchTerms.Text.Split(new char[] {' '})) { sqlDescription += "description LIKE '%" + term + "%' AND "; } sqlSearch += sqlSubject + " OR " + sqlDescription; Response.Write(sqlSearch); } I know the code isn't very clean and doesn't look like it does much but I have to get the basics working before I can actually do anything. I can't get the trim functions to work period and that's why they are not currently in this block of code. I have another app that one works in so I'm not sure what I'm doing wrong. If anyone knows why I am getting this error or what I am doing wrong please, please help. I am at a loss. I am developing on an XP machine with Visual Studio .NET. Thanks in advance. Jeff
-
are you trying to execute repeater 2 in each item of repeater one? I'm not sure if that would work. You may be able to use the OnItemDataBound-"YourFunctionHere" property of the repeater to build a function to display the data you want to display in repeater 2. hope this helps.
-
Someone please tell me I am overlooking something here. Is there an assembly reference I need to use this property? NewQuestionNum is an asp:textbox. The Response.Write is just test code I'm using becaue the property didn't work in another portion of my code. code: Response.Write(newQuestionNum.TextLength); error: CS0117: 'System.Web.UI.WebControls.TextBox' does not contain a definition for 'TextLength'
-
I'm guessing the directory you copied your project to on the server is not set up as an application. In IIS, right click on the directory and select properties. Under the application settings click create. That should do it.
-
I'm not sure I know exactly what you need but here is what I would do: use this in your try/catch try { // whatever you're trying to do } catch(Exception ex) { MyCustomErrorCatch(ex); } void MyCustomErrorCatch(Exception myCaughtException) { Response.Write(myCaughtException.ToString()); // you can write this out to the browser, a file, a database or what ever else }
-
I am hving trouble using a textbox in a repeater. I am able to find the textbox in each repeater item but cannot access the Text attribute of the textbox or the label for that matter. My code is as follows. Any help would be greatly appreciated. <script> void SubmitAnswers(object o, EventArgs e) { TextBox answer; Label answerNumber; foreach(RepeaterItem ri in questionsRpt.Items) { if(ri.ItemType == ListItemType.Item || ri.ItemType == ListItemType.AlternatingItem) { answerNumber = (Label)ri.FindControl("answerNumber"); Response.Write(answerNumber.ID); Response.Write(answerNumber.Text ); // no output here answer = (TextBox)ri.FindControl("answer"); Response.Write(answer.ID); Response.Write(answer.Text ); // no output here } } } </script> <asp:repeater ID="questionsRpt" runat="server"> <headertemplate> <table class="contenttext"> </headertemplate> <itemtemplate> <tr><td><asp:label ID="answerNumber" runat="server"><%# DataBinder.Eval(Container.DataItem, "number")%></asp:label>. </td><td><%# DataBinder.Eval(Container.DataItem, "question")%></td></tr> <tr><td></td><td><asp:textbox runat="server" MaxLength="1000" ID="answer" /></td></tr> </itemtemplate> <footertemplate> <tr><td></td><td align="right"><asp:button Text="Submit" runat="server" OnClick="SubmitAnswers" /></td></tr> </table> </footertemplate> </asp:repeater>
-
I would like to add an upload progress bar to a web based ftp program I developed. I don;t want to purchase an existing component because I would like to seamlessly integrate it with the already functional software. I want to code it myself but have no idea where to begin. Any suggestions?
-
I have an asp.net web app that accesses active directory to change a users password. it runs fine on the the machine I developed it on. win XP with IIS 5.1. but when migrating the app to our main server (windows 2000 server, iis 5.0) it produces an error when trying to access the active directory. Unknown error (0x80005000) at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) at System.DirectoryServices.DirectoryEntry.Bind() at System.DirectoryServices.DirectoryEntry.get_NativeObject() at System.DirectoryServices.DirectoryEntry.Invoke(String methodName, Object[] args) at adpwd.WebForm1.Button1_Click(Object sender, EventArgs e) I am at a loss and have looked for solutions, but to no avail. If anyone has any ideas please help! Jeff
-
I thought about doing two services but then realized that it would only check the user who the first service runs as. if someone else were to logon at a machine whose primary user has an expired password, it would direct them to change their password wether it was necessary or not. I'm hoping there is some way to check for the current user from the system account. Maybe I'll just ditch this approach and come at it from another angle. I guess I could always create a program that runs in the background that just starts when the user logs on. I was hoping to do it in a service so it was completely transparent to the user. Thanks for the responses.