2,245 Posted Topics
Re: I would create a "master size" and "master flavor" table. Then you could create an item, item size, and item flavor table and specify which combinations of item#/flavor/size are allowed and this would also give you the ability to add an up-charge based on either flavor or size. In the … | |
Re: This topic was also covered recently in another thread: [url]http://www.daniweb.com/forums/thread246995.html[/url] | |
Re: 365.25 is not accurate though. We have a leap year every 4 years, except where that year is evenly divisible by 100. Overriding the exception is if the year is evently divisible by 400 then it is a leap year. [code] if ( (((year mod 4) = 0) && ((year … | |
Re: Two or more fields used as a PRIMARY KEY are referred to as "composite", but that doesn't help you in solving your problem. You're also creating a new column and then losing the reference. You should be doing this: [code] private void button1_Click(object sender, EventArgs e) { DataTable dt = … | |
Re: You can use [icode]Exit While[/icode], [icode]Exit For[/icode], [icode]Exit Sub[/icode], etc. | |
Re: Upload a sample project demonstrating the problem. It is a lot of work to get a test scenario set up to answer your question. | |
Re: The visual studio designer reflects controls with the parameterless constructor to render the control in the IDE. You should always chain your constructors and have a public parameterless constructor which will render a valid control. For your form: [code] public partial class Form1 : Form { private int[] _array; public … | |
Re: This is the default behavior. Just call [icode].Undo()[/icode] multiple times. | |
Re: I have never heard about APF until now but after reading their site: [quote] The technical side of APF is such that it utilizes the latest stable features from the iptables (netfilter) project to provide a very robust and powerful firewall. [/quote] Is using [icode]iptables[/icode] directly a solution? | |
Re: You could do something like this: [code] using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Data.SqlClient; namespace daniweb { public partial class frmSelectEmployee : Form { const string connStr = "Data Source=apex2006sql;Initial Catalog=Leather;Integrated Security=True;"; private bool loaded; public frmSelectEmployee() { InitializeComponent(); … | |
Re: Give this a shot: [code] <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SignUp.aspx.cs" Inherits="daniweb.asp.SignUp" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title></title> </head> <body> <script type="text/javascript"> function copyValues() { document.getElementById("<%=TextBox2.ClientID%>").value = document.getElementById("<%=TextBox1.ClientID%>").value; } </script> <form id="form1" runat="server"> <div> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <br /> <asp:CheckBox ID="CheckBox1" runat="server" … | |
Re: What type of database connection are you using? The connection strings vary by driver. Here is some english variable names associated with the connection string file names: [code] public static string BuildSqlNativeConnStr(string server, string database) { return string.Format("Data Source={0};Initial Catalog={1};Integrated Security=True;", server, database); } public static string BuildSqlNativeConnStr(string server, string … | |
Re: I'm guessing you mean for advancing the list views selection? [code] Private Sub MoveNext() If (ListView1.Items.Count = 0) Then 'Nothing to selected ElseIf (ListView1.SelectedItems.Count = 0) Then 'Nothing selected, select the first ListView1.Items(0).Selected = True Else Dim idx As Integer If (ListView1.Items.Count - 1 > ListView1.SelectedIndices(0)) Then idx = ListView1.SelectedIndices(0) … | |
Re: Can you ZIP your project with the XML sample data and upload it? Click on "Go Advanced" (next to post quick reply) then click "Manage Attachments". One problem I see off-hand is: [code] dataGridView1.DataSource = xmldatadoc.DataSet; dataGridView1.DataMember = ResultNumT; [/code] That shouldn't be running inside of a loop | |
Re: What type of DLL is it and do you want to maintain C++ or are you wanting to move your code over to C#? You can use [icode]DllImport[/icode] to define the signatures and call the method: [code] [System.Runtime.InteropServices.DllImport("shell32.dll")] private static extern long ShellExecute(Int32 hWnd, string lpOperation, string lpFile, string lpParameters, … | |
Re: This sounds like an issue on the application side. Please post the code where you're using the SQL Reader to pull the data back. | |
Re: .NET does not manage memory like other traditional languages. The .NET CLR has a garbage collector that runs periodically to destroy objects and free memory once all references to the object have gone out of scope or are otherwise list. You should familiarize yourself with [Garbage Collection](http://msdn.microsoft.com/en-us/library/0xy59wtx.aspx): You can manually … | |
Re: The event you are looking for is [icode]onload[/icode], not [icode]oninit[/icode]: [code] <body onload="javascript:alert('hi');"> [/code] | |
Re: I tried to convince you that you had a null value in another thread: [url]http://www.daniweb.com/forums/thread248684-2.html[/url] I guess now you agree it is in fact a null? Please continue with the older thread instead of this one since it is the same question. | |
Re: The concept you're after is [URL="http://en.wikipedia.org/wiki/Inter-process_communication"]IPC[/URL] (inter-process communication). If the service and application run on the same machine you can use remoting and named pipes. You can also run services in desktop interactive mode so they can display items to the currently logged on user but that starts to get … | |
I think we have a math problem. On my profile stats it displays 654 solved threads and when I post it shows 644, so a difference of 10 (see solve1.png & solve2.png) Also on my friends page it has "Showing Friends 1 to 10 of 11" (friend1.png) but if you … | |
| |
Re: What webserver are you running? What language is the site written in? What access do you have to the server? You haven't provided enough information for anyone to form an approach.... | |
Re: Override the [icode]OnInit()[/icode] method of your page: [code] protected override void OnInit(EventArgs e) { #if DEBUG if (string.Compare(Request.QueryString["sel"], "ss", true) != 0) { Response.Redirect(@"http://server/foldertest/Page.aspx?sel=ss"); } #endif base.OnInit(e); } [/code] That should run early enough in the page life cycle to keep your page from bombing out. You could also set … | |
Re: As far as I know you can't do that in .NET without using either WMI or the w32 API: [code] public const int TOKEN_QUERY = 0X00000008; const int ERROR_NO_MORE_ITEMS = 259; enum TOKEN_INFORMATION_CLASS { TokenUser = 1, TokenGroups, TokenPrivileges, TokenOwner, TokenPrimaryGroup, TokenDefaultDacl, TokenSource, TokenType, TokenImpersonationLevel, TokenStatistics, TokenRestrictedSids, TokenSessionId } [DllImport("advapi32")] … | |
Re: Here is an example of making a textbox grow wider if the input is longer than the controls width: [code] private void textBox1_TextChanged(object sender, EventArgs e) { using (Graphics g = textBox1.CreateGraphics()) { textBox1.Width = Convert.ToInt32(Math.Max(textBox1.Width, Math.Ceiling(g.MeasureString(textBox1.Text, textBox1.Font).Width))); } } [/code] | |
Re: Are you getting the requests over UDP or TCP? DNS uses both protocols.. Upload your network traffic capture for the DNS, its really hard to say without taking a look. You can use [URL="http://www.wireshark.org/"]wireshark[/URL] or [icode]tcpdump[/icode] to generate a pcap file. | |
Re: Your code doesn't make any sense: [icode]Do Until tr.Nodes.Count <= 1000[/icode]. In the above line of code you're continuing a loop until the node count is less than 1000 ... but in the body of the loop you're not removing any nodes so that loop will continue forever if you … | |
Re: You can also do culture-specific parsing of numbers: [code] private void button1_Click(object sender, EventArgs e) { CultureInfo ciEnglish = new CultureInfo("en-US"); CultureInfo ciFrench = new CultureInfo("fr-FR"); decimal dEnglish, dFrench; const string s = @"3.1415"; if (decimal.TryParse(s, NumberStyles.Number, ciEnglish, out dEnglish)) Console.WriteLine(string.Format("[en-US]: Parsed {0} to value: {1:F4}", s, dEnglish)); else Console.WriteLine(string.Format("[en-US]: … | |
Re: Take a look at these threads on MSDN: [url]http://social.msdn.microsoft.com/Forums/en/csharplanguage/thread/1a46601c-1468-434e-af62-41676337406e[/url] [url]http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/1f32b948-d29f-4c5e-bc51-ab5703d25585[/url] | |
Re: [B]>>2. I simply don't understand the difference between two arrays whose indexing are marked [][] and [ , ] repectively. I probably overlooked a section in my reading because it seems to be an elementary concept. Here is an example code. My questions are written as comments[/B] [icode]int[,][/icode]: [URL="http://msdn.microsoft.com/en-us/library/2yd9wwz4.aspx"]Multi-dimensional array[/URL] … | |
Re: Can you explain why it would be a good idea to help you? Forgive me but this thread screams malicious. | |
Re: You should probably override [icode]ProcessCmdKey()[/icode] to handle your logic: [code] Protected Overrides Function ProcessCmdKey(ByRef msg As System.Windows.Forms.Message, ByVal keyData As System.Windows.Forms.Keys) As Boolean If (keyData = Keys.Tab) And (Me.ActiveControl Is TextBox1) Then MessageBox.Show("return") Return True 'Stops the tab from being processed Else Return MyBase.ProcessCmdKey(msg, keyData) End If End Function [/code] | |
Re: Use [icode]System.Reflection.Assembly.LoadFile("C:\assembly.dll")[/icode] | |
Re: You can get the client computer name with [icode]Environment.MachineName[/icode]. To get the SQL Server's name you can submit this query: [code=sql] Select Cast(@@SERVERNAME as varchar) [/code] | |
Re: The array is by reference and you're re-using the same reference over and over: [code] System.Collections.Queue Myqueue= new System.Collections.Queue(20); public byte[] Bytearray = new byte[2]; Myqueue.Clear(); while (Myqueue .Count !=20) { Bytearray = new byte[2]; //Instantiate a new array Temp=Calc(Bytearray); Bytearray[0] = temp[8]; Bytearray[1] = temp[13]; Myqueue.Enqueue(Bytearray); } [/code] | |
Re: You should use parameterized SQL so you don't have to worry about formatting: [code] private void button2_Click(object sender, EventArgs e) { const string connStr = "Data Source=apex2006sql;Initial Catalog=Leather;Integrated Security=True;"; const string query = "Select * From Invoice Where (InHomeDate BETWEEN @Date1 and @Date2)"; using (SqlConnection conn = new SqlConnection(connStr)) { … | |
Re: Why don't you use a grid? You can load up the results of your query in to a [icode]DataTable[/icode] and bind the grid to the database. Then you could hook up events to the grid so when the user clicks on a row in the grid it displays each of … | |
Re: You are correct in using [icode]Request.UserHostAddress[/icode]. If you use a browser on the server and navigate to the page then of course you would get the servers ip -- since it is both the client and server. If you use a remote client then you will see a different IP … | |
Re: If you don't already have a Global.asax then right click on the project and select "Add -- New Item" then select "Global Application Class". Modify your Global.asax: [code=c#] using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Security; using System.Web.SessionState; using System.Net.Mail; using System.Net; namespace daniweb.asp { public class Global … | |
Re: You should initialize your control in the control's Load event. There is no sense in loading a picture in your control until the window handle is created and you're about to display the control. You can also test if you're in [URL="http://msdn.microsoft.com/en-us/library/system.componentmodel.designerproperties.getisindesignmode.aspx"]design-time[/URL]: [code] System.ComponentModel.DesignerProperties.GetIsInDesignMode(this)) [/code] | |
![]() | Re: This functionality is beyond what visual studio deployment projects are capable of. Basically if you want to do anything except a vanilla install you should consider using [URL="http://wix.sourceforge.net/"]Windows Installer XML (WiX) toolset[/URL] which will be part of Visual Studio 2010. You could add a custom action to your application for … ![]() |
Re: Wal-Mart may be losing the holiday spirit but [URL="http://www.washingtontimes.com/news/2009/dec/19/court-allows-toughest-sheriff-his-christmas-music/"]Joe Arpaio[/URL] will be sharing christmas decor and music from around the world with ~8000 citizens of AZ :) | |
Re: That is commonly called "relative dates". I don't know if this will help you any: [code] using System; using System.ComponentModel; namespace XXX.Core { public enum RelativeDate { [Description("Today")] Today, [Description("Yesterday")] Yesterday, [Description("Tomorrow")] Tomorrow, [Description("First day of previous Week")] FirstDayPreviousWeek, [Description("First day of previous Month")] FirstDayPreviousMonth, [Description("First day of previous Year")] … | |
Re: So what is your question exactly? And what errors are you seeing when you attempt to run your application? | |
Re: Use [icode]Environment.GetFolderPath()[/icode]: [code] Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim sDir As String = GetMyCustomDesktopFolderPath() Dim fName As String = "myfile.txt" Dim sFull = System.IO.Path.Combine(sDir, fName) System.IO.File.WriteAllText(sFull, "abc123") End Sub Private Shared Function GetMyCustomDesktopFolderPath() As String Const exampleDirName As String = "VB.Net Example" Dim … | |
Re: This is more of an SQL question than VB.NET: [code=sql] IF OBJECT_ID('tempdb..#Temp', 'U') IS NOT NULL DROP TABLE #Temp Create Table #Temp ( UserName varchar(10), [Admin] bit ) Declare @UserName varchar(10), @Admin bit Set @UserName = 'sknake' Set @Admin = Cast(1 as bit) --Ok we have the test environment set … | |
Re: I think you have over-complicated your SQL statement. You could simply use: [code=sql] Select COUNT(DISTINCT(EntryNo)) From Cash Where PmtDat = 5 [/code] A full example: [code=sql] IF OBJECT_ID('tempdb..#Cash', 'U') IS NOT NULL DROP TABLE #Cash Create Table #Cash ( EntryNo int, PmtDat int ) Insert Into #Cash (EntryNo, PmtDat) Values … | |
Re: [B]>>I inserted a value of DateTime into database, like "26.12.2009 11:50:00" . Is it possible that the reader will read only the time of a day from this, without date?[/B] What type of database are you working with? You should use parameterized SQL when inserting data. If you convert the … | |
Re: Why would you want to read a file byte-by-byte? That will result in a lot of small I/O calls. You should read the file in chunks and buffer the results in memory and process it from there. This will do what you asked but will tax the machine heavily and … |
The End.