2,245 Posted Topics

Member Avatar for terdie

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 …

Member Avatar for sknake
0
88
Member Avatar for JayOne

This topic was also covered recently in another thread: [url]http://www.daniweb.com/forums/thread246995.html[/url]

Member Avatar for sknake
0
208
Member Avatar for cwarn23

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 …

Member Avatar for vegaseat
-3
183
Member Avatar for snakay

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 = …

Member Avatar for snakay
0
1K
Member Avatar for OldQBasicer

You can use [icode]Exit While[/icode], [icode]Exit For[/icode], [icode]Exit Sub[/icode], etc.

Member Avatar for Progr4mmer
0
156
Member Avatar for ludamizleeto

Upload a sample project demonstrating the problem. It is a lot of work to get a test scenario set up to answer your question.

Member Avatar for ludamizleeto
0
794
Member Avatar for Egypt Pharaoh

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 …

Member Avatar for sknake
0
84
Member Avatar for MxDev
Member Avatar for sknake
0
2K
Member Avatar for =IceBurn=

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?

Member Avatar for =IceBurn=
0
633
Member Avatar for shreyas2785

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(); …

Member Avatar for sknake
0
202
Member Avatar for happyns

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" …

Member Avatar for happyns
0
100
Member Avatar for bords

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 …

Member Avatar for pmatah
0
112
Member Avatar for tqmd1

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) …

Member Avatar for tqmd1
0
98
Member Avatar for rooboy69

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

Member Avatar for sknake
0
469
Member Avatar for Karthika_g

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, …

Member Avatar for sknake
0
150
Member Avatar for dskumar_85

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.

Member Avatar for mail2saion
0
77
Member Avatar for shabeg

.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 …

Member Avatar for sknake
0
1K
Member Avatar for emilio

The event you are looking for is [icode]onload[/icode], not [icode]oninit[/icode]: [code] <body onload="javascript:alert('hi');"> [/code]

Member Avatar for sknake
0
83
Member Avatar for tqmd1

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.

Member Avatar for sknake
0
722
Member Avatar for princesspretear

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 …

Member Avatar for sknake
0
587
Member Avatar for sknake

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 …

Member Avatar for sknake
0
198
Member Avatar for help108

I don't understand what you're asking. Could you provide more detail?

Member Avatar for sknake
0
325
Member Avatar for naziatarannum

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....

Member Avatar for serpiko
0
333
Member Avatar for LaSalle5067

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 …

Member Avatar for sknake
0
116
Member Avatar for Lolalola

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")] …

Member Avatar for Lolalola
0
581
Member Avatar for naren7

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]

Member Avatar for sknake
0
121
Member Avatar for bbailey

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.

Member Avatar for sknake
0
121
Member Avatar for samehsenosi

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 …

Member Avatar for sknake
0
114
Member Avatar for NargalaX

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]: …

Member Avatar for NargalaX
0
287
Member Avatar for compovet

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]

Member Avatar for compovet
0
221
Member Avatar for Chopinson

[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] …

Member Avatar for Chopinson
0
134
Member Avatar for Progr4mmer

Can you explain why it would be a good idea to help you? Forgive me but this thread screams malicious.

Member Avatar for Progr4mmer
0
38
Member Avatar for Ulukay

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]

Member Avatar for LennieKuah
0
140
Member Avatar for muzzy1000
Member Avatar for sknake
0
71
Member Avatar for tqmd1

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]

Member Avatar for sknake
0
97
Member Avatar for FX2236

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]

Member Avatar for sknake
0
202
Member Avatar for mshravs

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)) { …

Member Avatar for sknake
0
147
Member Avatar for szkoda

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 …

Member Avatar for szkoda
0
139
Member Avatar for ultras1

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 …

Member Avatar for Kusno
0
92
Member Avatar for GajananPund

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 …

Member Avatar for GajananPund
0
167
Member Avatar for moroshko

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]

Member Avatar for moroshko
0
624
Member Avatar for Peric

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 …

Member Avatar for Peric
0
585
Member Avatar for Ancient Dragon

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 :)

Member Avatar for hotmatrixx
2
126
Member Avatar for tig2810

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")] …

Member Avatar for sknake
0
143
Member Avatar for phalaris_trip

So what is your question exactly? And what errors are you seeing when you attempt to run your application?

Member Avatar for phalaris_trip
0
100
Member Avatar for manutd4life

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 …

Member Avatar for sknake
0
164
Member Avatar for LennieKuah

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 …

Member Avatar for sknake
0
230
Member Avatar for zurehman

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 …

Member Avatar for sknake
0
124
Member Avatar for Mitja Bonca

[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 …

Member Avatar for eeyc
0
3K
Member Avatar for sidd.

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 …

Member Avatar for eeyc
0
838

The End.