
reagan123
Avatar/Signature-
Posts
38 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by reagan123
-
actually it seems to work a bit now... i get the systems message first.. then pops up the message box saying the error has been logged. how would i get it to not show the first message An unhandled exception of type "System.FormatException" occured in mscorlib.dll Break -- Continue -- Help
-
I'm trying to walk through the example at this link for logging unhandled exceptions in the event log. When I run the example and try to get an error, I get the normal error message and my program shuts down... it doesn't log the error. Anyone know what to try to get this to work? thanks Article found here: http://www.quepublishing.com/articles/article.asp?p=31321&seqNum=5
-
i think that may do the trick... i'll give it a shot later, thanks for the suggestion.
-
hmm. not quite my problem. let me try and re-explain. I am populating a combo box from a table called subscriptions. This table has 'subscriptionID' and 'subscription' in the table. I'm putting the 'subscriptionID' field in the combo box value member and putting the 'subscription into the display member. Once that is loaded, i'm pulling a record out of a table that contains 'softwareID', 'softwareName', 'binderID', 'subscriptionID'. I need to make the dropdown box be selected to the value of subscriptionID from this table. Basically, if the record I pull out of the second table has a 'subscriptionID' of 2, then the dropdown box needs to be on the item that has the valuemember of 2. Does that make sense? thanks so far for the help!!
-
ok, should be simple, but i'm having a hard time getting this to work. I have a combo box that is populated with the following. da.Fill(ds, "Subscription"); cboSubscriptions.DataSource = ds.Tables["Subscription"]; cboSubscriptions.DisplayMember = "SubscriptionNo"; cboSubscriptions.ValueMember = "SubscriptionID"; Value Member DisplayMember 1 2323235235 2 3352525233 3 4564564564 etc.... This works fine but once the combo box is populated is where i'm having my trouble. I'm getting some values out of a database table that have the 'SubscriptionID' in it. How can I take the database value and then have the combo box selected based off of that value. If i'm pulling a subscriptionID of '2' out of the database, i need to set the combo box to show 3352525233. thanks.
-
using select method of dataset and binding?
reagan123 replied to reagan123's topic in Database / XML / Reporting
Got it to work using the following. I'm still open to suggestions if there is a better way of doing this. try { // Apply Filter Expression this.dsSoftwareLocations1.Tables["software"].DefaultView.RowFilter = "Software='" + this.cboSoftware.Text + "'"; // Gets the number of records in the DataView after // RowFilter and RowStateFilter have been applied. if (dsSoftwareLocations1.Tables["software"].DefaultView.Count > 0) { dgLocations.DataSource = dsSoftwareLocations1.Tables["software"].DefaultView; } else { MessageBox.Show("Filter criteria does not meet criteria"); } } -
I�m playing around with an ado.net windows form application and ran into a problem. I have a data set that is filled. I�m trying to use the select method on a dataset to filter some records� when I bind the results to the datagrid I�m getting extra columns in the grid like the follosing. HasErrors | RowError | Table | etc� What do I need to do in order to have it display just the columns from the dataset?. Here is the code. Thanks for any suggestions. try { dgLocations.DataSource = this.dsSoftwareLocations1.Tables["software"].Select("Software='" + this.cboSoftware.Text + "'"); // this.dgLocations.DataSource = this.dsSoftwareLocations1.Tables["software"]; } catch(Exception ex) { MessageBox.Show(ex.Message); }
-
multiple stored procedure parameters...???
reagan123 replied to reagan123's topic in Database / XML / Reporting
thanks, that seems to work... is all the other stuff i had initially just extra fluff. is there any reason why i need to specify that info? thanks for the help. -
I am trying to execute a sql server stored procedure from a c# windows app. I need to send it 3 parameters, is this the correct way to do that or am taking the long route. any feedback greatly appreciated! Thanks private void btnUpdate_Click(object sender, System.EventArgs e) { try { string strConnection = ConfigurationSettings.AppSettings["ConnectionString"]; SqlConnection cnn = new SqlConnection(strConnection); SqlCommand objCommand = new SqlCommand("usp_InsertSoftware", cnn); objCommand.CommandType = CommandType.StoredProcedure; SqlParameter objParameter = new SqlParameter("@softwareName",SqlDbType.VarChar, 100); objCommand.Parameters.Add(objParameter); objParameter.Direction = ParameterDirection.Input; objParameter.Value = this.txtSoftware.Text; SqlParameter objParameter1 = new SqlParameter("@binderID",SqlDbType.Int); objCommand.Parameters.Add(objParameter); objParameter1.Direction = ParameterDirection.Input; objParameter1.Value = this.cboBinders.SelectedValue; SqlParameter objParameter2 = new SqlParameter("@subscriptionID",SqlDbType.Int); objCommand.Parameters.Add(objParameter2); objParameter2.Direction = ParameterDirection.Input; objParameter2.Value = this.cboSubscriptions.SelectedValue; cnn.Open(); objCommand.ExecuteScalar(); MessageBox.Show("Software has been added"); cboSoftware.DataSource= null; bindSoftware(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { //clean up } }
-
i know i can use string.replace to find a character and then replace it with another... what if i want to find 2 characters? what is the best thing to use? can this be done with one string.replace() or two of them (one for each character) or is there a better way? i want to be able to remove '&' or '=' from a string. thanks for the insight. //Gets rid of '&' character string test = "This & That"; test=test.Replace("&", " "); Console.WriteLine(test);
-
passed it as a string and it worked.. thanks so much.
-
i'll try to pass it as a string as suggested above... i'll be back with the results :) thanks so much for all of the help.
-
sure.. when i sent 105 i got an error.. this is cut and pasted from the integration guide.. .thanks so much for your patience and help EXPDATE -- Expiration date of the credit card in mmyy format. For example, 0308 represents March 2008. Required=Yes Type=Numeric MaxLength=4
-
ok.. but i need to send an integer value to an api... it's expecting the format to be a four digit integer such as '0105' or '0607' or whatever... how do i get it in that format? any suggestions?
-
man.. still having problems.. .here's the overall picture. I have to drop down lists ddlMonth and ddlYear. ddlMonth is populated like this. <asp:ListItem Value="1">01</asp:ListItem> <asp:ListItem Value="2">02</asp:ListItem> <asp:ListItem Value="3">03</asp:ListItem> ... <asp:ListItem Value="12">12</asp:ListItem> the ddlYear is populated like this. // Set the exp year drop down list values. int currentYear = DateTime.Now.Year - 2000; int finalYear = currentYear + 6; ddlExpYear.Items.Add(new ListItem("", "")); for(int i=currentYear; i<finalYear; i++) ddlExpYear.Items.Add(new ListItem(i.ToString("00"), i.ToString("00"))); What I'm trying to do is to get an int variable that ends up in this format '0205'... I can't seem to do it... I get '205' string month = ddlExpMonth.SelectedValue.Trim(); string year = ddlExpYear.SelectedValue.Trim(); int ExpDate = Int32.Parse(month+year); Please help if possible.
-
i think i got it.. i'll test it out tomorrow.. thanks for the clarification and suggestions
-
this seems to get all of the values on the right hand side of the equals sign. I still can't figure out how to assign these values to variables? Sorry for being such a basic question. Thanks so much for the help so far!!! string test = "RESULT=126&PNREF=V64F0A7D0BC2&RESPMSG=Under review by Fraud Service&AUTHCODE=010101&AVSADDR=Y&AVSZIP=Y&IAVS=N&PREFPSMSG=Review CeilingAmount&POSTFPSMSG=Review"; string[] arInfo = new string[12]; // define which character is seperating fields char[] splitter = {'&'}; arInfo = test.Split(splitter); for(int x = 0; x < arInfo.Length; x++) { int y = arInfo[x].IndexOf("="); string z = arInfo[x].Substring(y+1); Response.Write(z); }
-
i'm lost again... here's what i've come up with so far.. any comments or suggestions appreciated. string test = "RESULT=126&PNREF=V64F0A7D0BC2&RESPMSG=Under review by Fraud Service&AUTHCODE=010101&AVSADDR=Y&AVSZIP=Y&IAVS=N&PREFPSMSG=Review CeilingAmount&POSTFPSMSG=Review"; string[] arInfo = new string[12]; // define which character is seperating fields char[] splitter = {'&'}; arInfo = test.Split(splitter); for(int x = 0; x < arInfo.Length; x++) { Response.Write(arInfo[x]); } } not sure where to go from here.... :( i'm in the process of looking at the string properties... I'm still not sure how to assign the values to a variable....
-
nope.. hadn't thought about changing it after the value is selected... i think the -2000 should work, but if you feel like it, could you post an example for after the selection? ***EDIT hmm.. subtracting 2000 seems to give me the following 5,6,7,8,9 I'm trying to get 05,06,07 etc.. man I can't wait till i get better at this stuff :)
-
ok.. i have a drop down list that is populated by the following code // Set the exp year drop down list values. int currentYear = DateTime.Now.Year; int finalYear = currentYear + 5; ddlExpYear.Items.Add(new ListItem("", "")); for(int i=currentYear; i<finalYear; i++) ddlExpYear.Items.Add(new ListItem(i.ToString(), i.ToString())); works fine but it gives me the values 2005-2010 How can I tweak this to get it to show 05-10. I basically need to get a month value out of one ddl and then the year value in the other ddl and be able to assign them to an int in like this '1206'. Any suggestions? Thanks
-
hmm.. seems to work but now i have another problem that gives me an array with the values like this correct? RESULT=126 &PNREF=V63F0A7A001D &RESPMSG=Under review by Fraud Service &AUTHCODE=010101 &AVSADDR=Y &AVSZIP=Y &IAVS=N &PREFPSMSG=Review CeilingAmount &POSTFPSMSG=Review What i need to do know is get the value on the right hand of the '=' sign and assign that to a variable. Is that possible? I may be approaching this in the wrong way.
-
need basic help splitting string... hello, I need help parsing a string in c#... I can't find an example online, just one of those days I guess. What i'm trying to do is to parse the following string at the '&'. I want to get the values so I can then put them into a database table. RESULT=126&PNREF=V63F0A7A001D&RESPMSG=Under review by Fraud Service&AUTHCODE=010101&AVSADDR=Y&AVSZIP=Y&IAVS=N&PREFPSMSG=Review CeilingAmount&POSTFPSMSG=Review Can anyone get me started or point me in the right direction? :o I've looked into the split method... seems like it may work but i'm not sure if it will do what i'm looking for. Thanks
-
actually, that looks like it may be all of it... i'm not sure if this will work in a hyperlink.. you may need to make that column a link column (not sure if they are the same things) and then add the code to the 'ItemCommand' event. Also, I'm new to all of this so there may be a better way to do it. Good luck.
-
i had some old code that did that.. i don't have all of it but here is a snippet... let me know if it looks like something you could use.. if so, i'll try to dig up the project and see what the full code was sURL = "PartInfoQV.aspx?IsPopup=Y" sFeatures += (",height=770") sFeatures += (",width=900") sFeatures += (",top=75") sFeatures += (",left=75") sFeatures += (",resizable=yes") sFeatures += (",scrollbars=yes") sFeatures += (",status=yes") sFeatures += (",menubar=yes") sDHTML = "<script language=JavaScript> var myWindow; myWindow=window.open(" sDHTML += ("'" + sURL + "', ") sDHTML += "null, " sDHTML += ("'" + sFeatures + "'); myWindow.focus();") sDHTML += "</script>" Page.RegisterStartupScript("Popup", sDHTML)
-
i found it http://www.microsoft.com/downloads/...&DisplayLang=en *** NEW PROBLEM **************************************** I installed it and when I try to open the Solution file i get an error "The application for project c:\..\Duwamish.etp is not installed. Make sure the application for the project type (.etp) is installed." What do i need to do to run this on a standard edition of visual studio .net? thanks *******************************************************