
mike55
Avatar/Signature-
Posts
734 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by mike55
-
I have 5 tables thare are linked using a primary key, these are: Organization, Org_Membership, SMS_Credit, Login, and Org_Profile. There is also a sixth table: SentMessages. Currently I am running a command that select some data from each of the tables, places the data in a dataset and sends that to be binded to a gridview on my .aspx page. Here is the sql command that I am using: SELECT dbo.Organization.Org_ID, dbo.Organization.Org_Name, dbo.SMS_Credit.Credit, CONVERT(VARCHAR(10), dbo.Org_MemberShip.Start_Date, 103) AS Start_Date, CONVERT(VARCHAR(10), dbo.Org_MemberShip.Finish_Date, 103) AS Finish_Date, dbo.Org_MemberShip.Status, dbo.Org_MemberShip.Subscription_Type, dbo.Organization.Org_Country, dbo.Organization.DialingCode, dbo.Organization.Org_Email, dbo.Organization.Org_Phone, dbo.Organization.Addr1, dbo.Organization.Town, dbo.Organization.County, dbo.Organization.Member_Numb, dbo.Login.Email_Add, dbo.Login.UserName, dbo.Login.PlainPass, dbo.Org_Profile.AllowContact, dbo.Login.Login, dbo.Login.Forename, dbo.Login.Surname FROM dbo.Organization INNER JOIN dbo.Org_MemberShip ON dbo.Organization.Org_ID = dbo.Org_MemberShip.Org_ID INNER JOIN dbo.SMS_Credit ON dbo.Organization.Org_ID = dbo.SMS_Credit.Org_ID INNER JOIN dbo.Login ON dbo.Organization.Org_ID = dbo.Login.Org_ID INNER JOIN dbo.Org_Profile ON dbo.Organization.Org_ID = dbo.Org_Profile.Org_ID where (Org_Membership.Subscription_Type = 'trial' or Org_Membership.Subscription_Type = 'full') The above command runs correctly and returns all the data that I need. I have now been asked to calculate and display on the gridview the number of messages that each organisation has sent. This information is stored in the SentMessages table, which has all the messages sent and the organisation that sent it. To extract the information from this table, all I need to do is to use the following command: Select org_ID, count(org_id) as exp1 From SentMessages Group by org_id The problem is how can I link both commands together and have the second command performed based on the org_ID selected in the first command? One option that I have is to take the results of the first command and loop through it selecting the org_id and going to the database. However this would result in a significant performance overhead. Mike55.
-
Ok, I have taken Mondeo's advice and I am attempting to parse the file using a streamreader. To actually get the string result into a datatable I came across the following code: http://www.hotblue.com/article0000.aspx?a=0006 The only problem that I am having is translating the following validation statement: Regex re=new Regex("((?<field>[^\",\\r\\n]+)|\"(?<field>([^\"]|\"\")+)\")(,|(?<rowbreak>\\r\\n|\\n|$))"); Instead of this statement, I need to have a validator that handles 4 columns, the first two are alphanumeric values, the 3rd must be a phone number, and the 4th an email address. Any suggestions? Mike55.
-
Hi all Firstly apologies if the following posting is in the incorrect location. I have a .CSV file from which I read the data and put it in a dataset, the dataset then undergoes various actions and I end up putting the data into a sql server2005 database. The following is the code that I am using to access to .CSV file and extract the data: Public Function RetrieveCSVData() As Boolean RetrieveCSVData = True Dim cnnCSVConnection As OleDb.OleDbConnection = Nothing Try Dim fileName As String Dim path As String Dim dcUpload(0) As DataColumn If dstCSVFile.Tables.Count > 0 Then dstCSVFile.Tables.Remove("MemberData") End If fileName = System.IO.Path.GetFileName(mFilePath) path = mFilePath.Replace(fileName, Nothing) cnnCSVConnection = New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + path + ";Extended Properties=Text;") Dim cmdCSVCommand As OleDb.OleDbCommand = New OleDb.OleDbCommand("SELECT * FROM " & fileName, cnnCSVConnection) Dim adpCSV As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter(cmdCSVCommand) ' Open a connection to the .csv file and retrieve the data to a dataset. cnnCSVConnection.Open() adpCSV.Fill(dstCSVFile, "MemberData") 'LogEntry logAction.WriteLog(System.Configuration.ConfigurationManager.AppSettings("FilePath"), "Suretxtlog.txt", "RetrieveCSVData Passed!", "UploadDownload-RetrieveCSVData", "SuretxtWebService") Return RetrieveCSVData Catch ex As Exception logAction.WriteLog(System.Configuration.ConfigurationManager.AppSettings("FilePath"), "Suretxtlog.txt", ex.Message, "UploadDownload-RetrieveCSVData", "SuretxtWebService") RetrieveCSVData = False Finally ' Close the database connection. cnnCSVConnection.Close() End Try End Function The problem is that the select command doesn't always return all the data in the .CSV file. The current problem that I am having is that the first column is being returned as blank. I have attached the .csv file for people to have a look at (Note the file had to be uploaded as a .txt file). The problem only seems to occur when there is a limited amount of data in the .csv file. If I submit a file with 5 or 133 records no problems occur. After some further testing, I can confirm that the problem only exists when I have only one record in the .csv file. Should I go and add in a second record, and then do the import the problem does not occur. Mike55. Sample.txt
-
Any suggestions on how to do this, I am trying to get the number of minutes associated with the time at the moment and then use the Subtract method, don't think that this is the best approach and is going to cause a lot of problems. Mike55.
-
I have got around the problem to a point by using the following css code: .ajax__calendar_container {padding:4px;position:absolute;cursor:default;width:170px;font-size:11px;text-align:center;font-family:tahoma,verdana,helvetica;} .ajax__calendar_body {height:139px;width:170px;position:relative;overflow:hidden;margin:auto;} .ajax__calendar_days, .ajax__calendar_months, .ajax__calendar_years {top:0px;left:0px;height:139px;width:170px;position:absolute;text-align:center;margin:auto;} .ajax__calendar_container TABLE {font-size:11px;} .ajax__calendar_header {height:20px;width:100%;} .ajax__calendar_prev {cursor:pointer;width:15px;height:15px;float:left;background-repeat:no-repeat;background-position:50% 50%;background-image:url(<%=WebResource("AjaxControlToolkit.Calendar.arrow-left.gif")%>);} .ajax__calendar_next {cursor:pointer;width:15px;height:15px;float:right;background-repeat:no-repeat;background-position:50% 50%;background-image:url(<%=WebResource("AjaxControlToolkit.Calendar.arrow-right.gif")%>);} .ajax__calendar_title {cursor:pointer;font-weight:bold;} .ajax__calendar_footer {height:15px;} .ajax__calendar_today {cursor:pointer;padding-top:3px;} .ajax__calendar_dayname {height:17px;width:17px;text-align:right;padding:0 2px;} .ajax__calendar_day {height:17px;width:18px;text-align:right;padding:0 2px;cursor:pointer;} .ajax__calendar_month {height:44px;width:40px;text-align:center;cursor:pointer;overflow:hidden;} .ajax__calendar_year {height:44px;width:40px;text-align:center;cursor:pointer;overflow:hidden;} .ajax__calendar .ajax__calendar_container {border:1px solid #646464;background-color:#ffffff;color:#000000;} .ajax__calendar .ajax__calendar_footer {border-top:1px solid #f5f5f5;} .ajax__calendar .ajax__calendar_dayname {border-bottom:1px solid #f5f5f5;} .ajax__calendar .ajax__calendar_day {border:1px solid #ffffff;} .ajax__calendar .ajax__calendar_month {border:1px solid #ffffff;} .ajax__calendar .ajax__calendar_year {border:1px solid #ffffff;} .ajax__calendar .ajax__calendar_active .ajax__calendar_day {background-color:#edf9ff;border-color:#0066cc;color:#0066cc;} .ajax__calendar .ajax__calendar_active .ajax__calendar_month {background-color:#edf9ff;border-color:#0066cc;color:#0066cc;} .ajax__calendar .ajax__calendar_active .ajax__calendar_year {background-color:#edf9ff;border-color:#0066cc;color:#0066cc;} .ajax__calendar .ajax__calendar_other .ajax__calendar_day {background-color:#ffffff;border-color:#ffffff;color:#646464;} .ajax__calendar .ajax__calendar_other .ajax__calendar_year {background-color:#ffffff;border-color:#ffffff;color:#646464;} .ajax__calendar .ajax__calendar_hover .ajax__calendar_day {background-color:#edf9ff;border-color:#daf2fc;color:#0066cc;} .ajax__calendar .ajax__calendar_hover .ajax__calendar_month {background-color:#edf9ff;border-color:#daf2fc;color:#0066cc;} .ajax__calendar .ajax__calendar_hover .ajax__calendar_year {background-color:#edf9ff;border-color:#daf2fc;color:#0066cc;} .ajax__calendar .ajax__calendar_hover .ajax__calendar_title {color:#0066cc;} .ajax__calendar .ajax__calendar_hover .ajax__calendar_today {color:#0066cc;} However, I have been unable to display the arrows at either side to change the month. Mike55.
-
I'm having problems with the calendar extender in that there is no buttons at the top of the calendar to move between the months, and that the control seems to be the width of my page. Here is the actual code belonging to the extender: <cc3:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtCalendar" Format="dd/MM/yyyy" PopupButtonID="imgCalendar" CssClass="MyCalendar"> </cc3:CalendarExtender> Mike55.
-
Does anyone know what version of Vista I need in order to install Visual Studio .net 2005 and potentially Visual Studio .net 2008. I have been looking at the system requirements on the Microsoft site, and all it says is that Vista is required, is the business version sufficient or must I go for the ultimate version? Mike55.
-
I am using the wizard control to carryout a number of steps, quite a handy little control. I have only one problem with the control, and it relates to the valign ment of items in the main section area. How can I have everything aligned to the top left corner? Mike55.
-
In relation to problem 1, the grid is doing a post back which effectively reloads the data. Try placing your call to the database inside an if not ispostback statement. Mike55.
-
Have you considered the ajax control toolkit? As far as I remember there is a video on http://www.asp.net that might help you to do what you want. Mike55.
-
Ok, it seems that Between has problems when the datatime has a non-zero time value. According to Roy Harvey at http://www.thescripts.com/forum/thread535358.html "the end date has not time and any rows with non-zero times for that date are outside the range, and thus excluded". Mike55.
-
I am using a between command in an sql statement. If I go to my SQL server manager and enter the command directly, Select * From members where DOB between '08/28/2007' and '08/28/2007', I get back all those records that are have the DOB 08/28/2007. However if I run the same statement from my code, I cannot get any of the values for the DOB 08/28/2007, if I change the between command from the 08/27/2007 and 08/29/2007 I get the records that I am looking for. Any suggestions in regards to the difference? Alternatively, is their some inclusive command I can include? Mike55.
-
Re: Two ideas I tried both suggestions however was unable to get anywhere. What I eventually did was to create a new page from scratch and added the controls as I needed them. This worked. The only thing that I can think of was that an infragistics control that I was using was somehow conflicting with the agile controls. Mike55.
-
I have a dropdown list in a view belonging to a multiview control. This control is then inside an ajax update panel. My problem is that the the drop down won't call the method that handles the selected index change when the dropdown item selected is changed: <asp:DropDownList ID="ddGroups" runat="server" AutoPostBack="True"> </asp:DropDownList> 'Based on the group selected, get all the members assigned to that group. Protected Sub ddGroups_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddGroups.SelectedIndexChanged LoadGroupMembers() End Sub Mike55.
-
I am using a drop down list which has auto-postback enabled as the option selected will enable a particular view in a multiview control. I am using the ajax update panel in order to prevent the post backs appearing to the user and showing the page being reloaded. However, the control seems to be throwing an error. The error occurs in the function "igtbl_submit()" in the file "Resource.axd" which appears to be automatically generated by .net. The exact error message that I am getting is: "Microsoft JScript runtime error: 'window.__thisForm.igtblGrid' is null or not an object" Any suggestions Mike55
-
Problem solved, I used the following: HttpContext.Current.User = New System.Security.Principal.GenericPrincipal(HttpContext.Current.User.Identity, role) Mike55.
-
I have been following a video on http://www.asp.net regarding user roles. Can anyone point me to a resource where someone has implemented the functions programatically i.e. go to their own database validate user return details and assign them to a role. Mike55.
-
In the end I had to copy up the setup file for my project. Once copied, I installed the application. I then had to open the command prompt and navigate to the windows folder, and the folder for version 2.0.50727. I then had the use the command "installutil" and specify the location of the .exe file i.e. c:/programfiles etc. however to get the installutil command to work I had to place the file location in quotation marks. Mike55.
-
I need to validate the first two characters of a mobile phone number. I know that the length of the number is 10 characters, and that the first two will be 0 and 8. The third character can be either 5, 6, 7, or 8. I have been going through various tutorials, but I am hitting a brick wall. Mike55.
-
Worked like a charm, many thanks. All i need to do now is to look for support for the Irish language (Gaeilge). Can't see anything in the language options, but do see the option to add new languages. Mike55.
-
I am following the video "How do I: Create a Multi-Lingual Site with Localization?" and I am following the section on global resource files. When I try to add the attributes Culture="auto:en-US" and UICulture="auto" I get the following errors: Further information: I have named the resource file for the french language as Resource.fr-FR.resx, the file for the german lanaguage as Resource.de-DE.resx, while the file for the english language remains as Resource.resx Any suggestions? Mike55.
-
I am getting a System.Threading.ThreadAbortException when I run the following code: Try If HttpContext.Current.User.Identity.IsAuthenticated = True Then Response.Redirect("sendMessage.aspx", True) Else Response.Redirect(ConfigurationManager.AppSettings("Home").ToString, True) End If Catch ex As Exception LogError(ex.Message, "User clicked the cancel button") End Try [/code/ The value for "Home" in my web.config file is: "~/sales/index.html" I cannot see anything obvious, any suggestions? I even moved the line: [code] ConfigurationManager.AppSettings("Home").toString to dim redirect as string = ConfigurationManager.AppSettings("Home").Tostring response.redirect(redirect, true) Mike55. Found the solution, change to response.redirect(redirect, false)
-
Thanks for the reply PlausiblyDamp, I should have mentioned that my two methods are located in two different objects so I need to createa response object. Based on what you are saying, I should locate this line to outside the foreach loop and only create one object instead of three. I will also try the response.Close() option. Again many thanks. Mike55.
-
Hi My windows service is capable of connecting to a third party service provider, http://www.clickatell.com in this case. I am using the third party to send out a number of sms text messages in the event that another service goes down or fails to reply within a specific timeframe. I am using a List<string> to store the list of number that I am sending to, and passing my message as a string. The problem that I am having is that when I go to send the last message, I get a timeout exception. I have tried to get the service to sleep for 15 seconds before sending each message, but this has had no effect. Here is the code that I am using: //Queue the message to the EMS personnel, and send it. private static void QueueEMSMessages(ClubtextMonitor.Modules.MonitorConnect myConnection, String sysMessage) { //Get the person who is to receive the message. List<string> msgDestination = myConnection.GetTechSupport(); //Create the message and send it to the support person. foreach (string ems in msgDestination) { try { ClubtextMonitor.Modules.Message errMessage = new ClubtextMonitor.Modules.Message(sysMessage, ems); //Wait for 15 seconds before sending the message System.Threading.Thread.Sleep(15000); errMessage.sendMessage(); } catch (Exception ex) { } } } //Allow the client to send the message for the user. public bool sendMessage() { //Parameter for storing the send message credentails string[] credentials; //Get the credentials necessary for sending the message. ClubtextMonitor.Modules.MonitorConnect connection = new ClubtextMonitor.Modules.MonitorConnect(); credentials = connection.GetCredentials(); bool outputValue = false; //Ensure that the correct number of credentials have been supplied. if (3 == credentials.Length) { outputValue = true; WebRequest objRequest; //The web request to be sent to the message gateway. string msgRequest; msgRequest = "http://api.clickatell.com/http/sendmsg?user=" + credentials[1].ToString() + "&password=" + credentials[2].ToString() + "&api_id=" + credentials[0].ToString() +"&to=" + msgDestination + "&text=" + msgText; //Send the message to the individual on tech. support. objRequest = System.Net.HttpWebRequest.Create(msgRequest); objRequest.GetResponse(); } else { outputValue = false; } return outputValue; } Mike55.
-
I have created a windows service, I have also created the Setup package for this service. When I am testing the service on my development machine I use the following cmd: installutil abc.exe to install the service. I have a number of break points in my code, and have the line Debugger.Launch() in the OnStart(). Therefore when I go to services in control panel, and start my windows service, I am asked what debugger I want to use. That is grand, no problems there, and I am able to debug my code. I then remove the line Debugger.Launch(), rebuild my project, rebuild my setup project in release mode. I then transfer the setup project files to the deployment server, and double click on release\abc.exe. This is where my problems are occuring, When I go to the services application, my application abc does not show. If I go to the add remove programs option I can see my application. Likewise if I go to the event viewer and look at the applications log I see that abc has been installed without any problem. I have tried to use the installutil command on the server with the .exe installed. However I get the following message: "Exception occured while initializing the installation. The format of the file abc.exe is invalid..." Any suggestions on where I am going wrong? Mike55.