2,245 Posted Topics

Member Avatar for ShailaMohite

Try 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; namespace daniweb { public partial class frmGridView2 : Form { DataTable dt; private TextBox editingBox; //I cant find where the gridView holds the reference public frmGridView2() { InitializeComponent(); editingBox = default(TextBox); …

Member Avatar for prampe
0
6K
Member Avatar for babbu

Is the input fixed at all? You could use a MaskedTextBox and set the mask to a numeric mask. There is also a numeric control you could use: [url]http://www.codeproject.com/KB/edit/TNumEditBox.aspx[/url]

Member Avatar for Reverend Jim
0
3K
Member Avatar for kimbula...

Please use code tags in the future [code = VB.NET] <- Remove the spaces and it will work code here [/code] To answer your question you should move the functionality to another method instead of calling the button's click event, but: [code=vb.net] Private Sub Button1_Click(ByVal sender As System.Object, ByVal e …

Member Avatar for chickss
0
25K
Member Avatar for babbu

That is not enough information. You can use the import/export wizard built in the SQL Server Management studio. Excel has a limit ~65535 if i recall correctly (may be more in the newer version) so you might not be able to export all of your data. Also do you want …

Member Avatar for Cameronsmith63
0
190
Member Avatar for pdoyle1521

Post the [icode]CREATE TABLE[/icode] SQL for you Customer table. Is the CustomerId an integral field?

Member Avatar for bilal maverick
0
1K
Member Avatar for phalaris_trip

[QUOTE=phalaris_trip;928954] I wonder if there's a way to force the OS to invalidate or something...[/QUOTE] Invalidate just causes the invalidated region of the screen/form to be redrawn. You need explorer to truly do a refresh of the data subset to display the files. Refreshing explorer: [url]http://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/2ca36f68-d70d-4012-a5fb-4580be9b344f[/url]

Member Avatar for tnjman
0
545
Member Avatar for Diamonddrake
Member Avatar for elidotnet

Look at the output window after you click the button. Do you see an exception similar to: [code]A first chance exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll[/code]

Member Avatar for prathamesh3090
1
7K
Member Avatar for DIPY

You can use a one-liner ;) [code] textBox1.Enabled = checkBox1.Checked; [/code] DIPY -- Are you getting a callstack overflow error? I'm looking at the code you pasted and in the event you are changing the check status of the checkbox that fired the event. [code] public void Checked_Changed(Object sender, EventArgs …

Member Avatar for hirenpatel53
0
3K
Member Avatar for arelius

This should do the trick for you. [code=csharp] private void frmGridView_Load(object sender, EventArgs e) { this.customerTableAdapter.Fill(this.dataSet1.Customer); } private void button1_Click(object sender, EventArgs e) { DataSet ds = new DataSet(); DataTable dt = new DataTable(); dt.TableName = "MyTable"; foreach (DataGridViewColumn col in dataGridView1.Columns) { dt.Columns.Add(col.DataPropertyName, col.ValueType); } foreach (DataGridViewRow gridRow in …

Member Avatar for CaptainRon
0
5K
Member Avatar for Panathinaikos22

The above answers are 'technically' incorrect (but deceptikon did a great job explaining it). Exceptions are very expensive to be thrown, but are of little cost to be caught (not no cost). This is especially noticeable if they are thrown in code that is commonly called (painting, calculations, etc). try..catch{} …

Member Avatar for sknake
0
6K
Member Avatar for VidyaYadav

Try 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; namespace daniweb.mdi { public partial class frmMain : Form { public frmMain() { InitializeComponent(); } private Form OpenForm(Type t) { if (!t.IsSubclassOf(typeof(Form)) && !(t == typeof(Form))) throw new ArgumentException("Type is not …

Member Avatar for master_lam
0
2K
Member Avatar for omeja

I suppose it may be possible for `cert.SubjectName` to be null or `cert.SubjectName.Name` to be null. Also this part is incorrect: catch (Exception e) { throw e; } When you do that it re-throws the exception with new line numbers -- thus makes harder chasing down the actual problem. There …

Member Avatar for sknake
0
131
Member Avatar for suomynona
Member Avatar for shibin09

See: [URL="http://www.daniweb.com/web-development/databases/ms-sql/threads/287090"]Thread #1[/URL] [URL="http://www.daniweb.com/web-development/databases/ms-sql/threads/378099"]Thread #2[/URL] And this code snippet: [code] /// <summary> /// Verifies strong password against SQL 2008 settings /// </summary> /// <param name="password"></param> /// <returns></returns> [CustomAction] public static ActionResult IsSql2008StrongPassword(Session session) { session[PropertyNames.Apex_SqlFieldsValid] = "0"; //See: http://msdn.microsoft.com/en-us/library/cc281849.aspx #region password validation { //#1 - Done //Strong passwords are not …

Member Avatar for sknake
0
187
Member Avatar for poloblue

[code] using System; using System.Collections.Generic; using System.Linq; using System.Net.NetworkInformation; using System.Net.Sockets; namespace SerialTester { class NetworkHelper { static NetworkInterface[] GetAllNetworkInterfacesSafe() { try { return NetworkInterface.GetAllNetworkInterfaces() .Where(nic => (nic.IsReceiveOnly == false) && (nic.NetworkInterfaceType != NetworkInterfaceType.Loopback) && (nic.OperationalStatus == OperationalStatus.Up)) .ToArray(); } catch (Exception ex) { //log4net if (log.IsErrorEnabled) log.Error("Error retrieving network …

Member Avatar for sknake
0
176
Member Avatar for enbeeone3

Try doing a [icode]chmod -R 744 <dir>[/icode] on the directory. You will need to clean up the perms after you run that command. A directory in *nix needs the +x in order for you to "cd" in to it. [code=bash] sk@sk:/tmp/x$ ls -al total 9 drwxr--r-- 2 sk wheel 1024 …

Member Avatar for Gangajj
0
317
Member Avatar for nokomoli

I think this is what you want. Hard to say without the table structures or an accurate description. [code=sql] Select ID, Name, ( Select Sum(Points) From Table2 Where Table2.ID = Table1.ID ) As Total From Table1 Where ID >= 1 and ID <= 3 Order By ID [/code]

Member Avatar for gennesis
0
205
Member Avatar for yash777

[QUOTE=dnanetwork;918412]use application variable....works... 100%[/QUOTE] Application variables are not persisted and you will lose the count data. You can also take a look at a free application called smarter stats for weblog analysis. There is a lot more information to be had from IIS log files then the number of times …

Member Avatar for mirzamujib
0
173
Member Avatar for onat12`
Member Avatar for prit005
0
496
Member Avatar for Ratte

Paste sample code. You can do as much as you would like to in another thread. However BE WARNED you should _copy_ any [icode]byte[][/icode] buffers sent/received to any socket / serial ports. The memory is pinned by the CLR and modifying it will lead to rare but incredibly hard to …

Member Avatar for Ratte
0
243
Member Avatar for z_zendegi

If you can get ahold of your printer graphics or create an image you will find a [icode].VerticalResolution[/icode] and [icode].HorizontalResolution[/icode] that will give you the pixels per inch as danny indicated. Do the math and draw your shapes to the size you want and send them to the printer with …

Member Avatar for jz_gook
0
714
Member Avatar for violette

You should be using parameterized SQL. Its a lot easier to read queries and ensure you're not having datatype mismatches. [code] Imports System.Data.SqlClient Imports System.Text Public Class Form1 'Create Table TestTable '( ' Column1 varchar(100) PRIMARY KEY NOT NULL ') Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click …

Member Avatar for WaltP
0
598
Member Avatar for lxXTaCoXxl

What are you trying to do? Normally with a ping its along the lines of "are you there (echo request)?. Yes I am (echo response)." You normally don't want to populate any sort of buffer with pings (ICMP) unless you have a specific purpose for doing so. As far as …

Member Avatar for lxXTaCoXxl
0
153
Member Avatar for lxXTaCoXxl

Here are some network extensions that should help you out: [code=c#] static IEnumerable<UnicastIPAddressInformation> GetLocalIPv4Bindings() { NetworkInterface[] interfaces = NetworkInterface.GetAllNetworkInterfaces(); foreach (NetworkInterface ni in interfaces) { IPInterfaceProperties props; try { props = ni.GetIPProperties(); } catch { continue; } for (int i1 = 0; i1 < props.UnicastAddresses.Count; i1++) { if (props.UnicastAddresses[i1].Address.AddressFamily == …

Member Avatar for sknake
0
199
Member Avatar for visored23
Member Avatar for danuzje

Try this: [code=c#] void button1_Click(object sender, EventArgs e) { string s = Console.ReadLine(); System.IO.File.WriteAllText(@"C:\path\to\file.txt", s); } [/code]

Member Avatar for sknake
0
217
Member Avatar for sknake

This morning: [QUOTE] Total Down-Votes Received: [B][COLOR="Red"]33[/COLOR][/B] Unique Posts Receiving Down-Votes: 29 Individual Members Who've Down-Voted: [B][COLOR="Red"]6[/COLOR][/B] Posts Currently Negative: 13 [/QUOTE] Now: [QUOTE] Total Down-Votes Received: [B][COLOR="red"]61[/COLOR][/B] Unique Posts Receiving Down-Votes: 56 Individual Members Who've Down-Voted: [COLOR="red"][B]7[/B][/COLOR] Posts Currently Negative: 34 [/QUOTE] So one new person cast a vote …

Member Avatar for pseudorandom21
2
965
Member Avatar for Prakash_8111

Well it depends on how you want the scripts to interact with eachother. If you want to share environment variables that have not been exported then you would call the file with [icode]. /path/to/file.sh[/icode] or [icode]source /path/to/file.sh[/icode]. If you don't want to share the environment of the script you would …

Member Avatar for nikita.
0
3K
Member Avatar for educated_fool

Click on the installer in your solution explorer and look in the properties window. Set these properties: DetectNewerInstalledVersion = True RemovePreviousVersions = True That will allow you to upgrade machines and stop accidental downgrades.

Member Avatar for narin143
0
965
Member Avatar for carey_amanda

Please use code tags when posting code on daniweb: Which is why you should use the application data path for storing files so you dont run in to that issue: `string newPath = Path.Combine(Application.UserAppDataPath, "Download.txt");` You can take a look at the drive letter of the user app data path …

Member Avatar for devloper
0
202
Member Avatar for user543820

You may also consider using [icode]Regex.Split()[/icode] to split on word boundaries and filter out the punctuation. If you split on ' ' and you have "hi\r\nhello" then it will show up as one word because but its really on two different lines. I suppose if you use [icode].ReadLine()[/icode] for the …

Member Avatar for user543820
0
4K
Member Avatar for majorawsome

I think you are referring to the difference between encapsulation vs inheritence. They are well documented topics on the net so look up a few articles and see if that answers your question. If not post then please post back.

Member Avatar for majorawsome
0
156
Member Avatar for arunkumars

Taking a step back -- what exactly are you trying to do here? If you want absolute performance than managed code is not the answer. The ability to control struct layouts is present for interop reasons. For example see [URL="http://www.daniweb.com/software-development/csharp/threads/370676"]this thread[/URL]. You can instantiate structs faster than classes sure but …

Member Avatar for sknake
0
358
Member Avatar for Techyon

Have the developer download wireshark or better yet run wireshark on the server. Start the packet capture before he attempts to copy the files and run it for ~15 seconds after the packet capture fails. Take the PCAP file and upload it here or send me a private message (see …

Member Avatar for Techyon
0
281
Member Avatar for SteveyD

Can you post your latest copy of both .NET and Delphi source? This does not make sense: [code=c#] private void btnRX_Click(object sender, EventArgs e) { byte[] Data = new byte[256]; int i; string s; if (!(checkBox1.Checked)) { toolStripStatusLabel1.Text = "Bidirectional operation not allowed"; return; } for (i = 0; i …

Member Avatar for SteveyD
0
1K
Member Avatar for mdpepper

More ports than 1433 are typically involved in an SQL connection. Here is a batch file for opening ports on a default instance (non-named instance) of SQL: [code] netsh firewall set portopening TCP 1433 "SQLServer" netsh firewall set portopening TCP 1434 "SQL Admin Connection" netsh firewall set portopening TCP 4022 …

Member Avatar for sknake
0
216
Member Avatar for Pankaj18

The "attachment" in your content-disposition instructs the browser to prompt for saving. The desired behavior you're describing is inline: [code=c#] if (view) Response.AddHeader("Content-Disposition", "inline; filename = " + file.OriginalFileName); else Response.AddHeader("Content-Disposition", "attachment; filename = " + file.OriginalFileName); [/code]

Member Avatar for LaxLoafer
0
1K
Member Avatar for router.exe

[QUOTE=router.exe;1635438]it does appear to write to a local file...i think. the elevation window does not give me a lot of details. the application appears to have it's own updater, as in another exe file other than the program itself, and that is what is causing the need for elevation.[/QUOTE] I …

Member Avatar for sknake
0
224
Member Avatar for Jazerix

[QUOTE=Ketsuekiame;1636675]Yes, but I suggest not doing so and therefore will not say. "Catching" your entire program is ridiculously bad design and implementation. Fix your bugs, don't hide them.[/QUOTE] I wholeheartedly disagree. Per Microsoft if you want your software to be logo certified (Certified for Windows 7, etc) you are not …

Member Avatar for Jazerix
0
181
Member Avatar for Roobin

Here is how I handle reading masked bits: [code] public static class BITS { public const byte BIT0 = 0x01; public const byte BIT1 = 0x02; public const byte BIT2 = 0x04; public const byte BIT3 = 0x08; public const byte BIT4 = 0x10; public const byte BIT5 = 0x20; …

Member Avatar for sknake
0
855
Member Avatar for azamsalam

This is commonly referred to as a pivot. [code] IF OBJECT_ID('tempdb..#Parts', 'U') IS NOT NULL DROP TABLE #Parts Create Table #Parts ( ID int, ID2 int, PartNo varchar(10) ) SET NOCOUNT ON Insert Into #Parts (ID, ID2, PartNo) Values (75, 23921, 'DENT') Insert Into #Parts (ID, ID2, PartNo) Values (75, …

Member Avatar for dhfg
0
2K
Member Avatar for destruct0

I believe your problem lies outside of the code shown here. Could you zip your project and upload it to this thread?

Member Avatar for sknake
0
162
Member Avatar for harishbansal90

Don't install SQL 2008. Use SQL 2008R2 or SQL 2005. My software ships with SQL 2008R2 and I have had a few problems installing SQL server on home editions of windows due to missing privilieges. The below code has the privileges in question and an article: [code=c#] #region security token …

Member Avatar for sknake
0
455
Member Avatar for prit005

Group by every column you select. If the duplicates are somehow coming from a join it will still be eliminated in a group by. Example: [code=sql] IF OBJECT_ID('tempdb..#Table', 'U') IS NOT NULL DROP TABLE #Table GO Create Table #Table ( Id int identity(1000, 1) PRIMARY KEY, Name varchar(100) ) SET …

Member Avatar for Netcode
0
233
Member Avatar for vaishnu

I think you may mean FFF0 is hex. If so that is 2 bytes (32-bit). Other than that I can't really make sense of your question. The definition of first and last depends on [URL="http://en.wikipedia.org/wiki/Endianness"]endianness[/URL]. [code=c#] public static class BITS { public const byte BIT0 = 0x01; public const byte …

Member Avatar for ddanbe
0
149
Member Avatar for ghostrecon

Those two metrics are not necessarily related. Ping is round-trip latency, ie "it takes 300ms to send a packet then receive a response from the host". As you begin downloading it increases congestion on the line and results and in higher packet round-trip times. This is probably a question of …

Member Avatar for lasitha2005d
0
299
Member Avatar for xanawa

- Right click on the project in visual studio and select "open folder in windows explorer". - Close visual studio - Make a copy of the *.csproj file (backup) - Open the *.csproj file in notepad - Search for the resource name. You should see two duplicate entries. Delete one …

Member Avatar for sknake
0
99
Member Avatar for udigold1

[QUOTE=udigold1;1605693]Why this is happening? How can I make it color the cells right from the beginning?[/QUOTE] You don't want to. Classes inheriting from controls (including forms) rarely need code in the constructor aside from designer generated code. You should place this code in the form's Load event. A lot of …

Member Avatar for ddanbe
0
562
Member Avatar for emanfman

It executes line 3 and 4 over and over again: [code] cd "C:/" md "PC Killar" cd "C:/" md "PC Killar" cd "C:/" md "PC Killar" cd "C:/" md "PC Killar" cd "C:/" md "PC Killar" ..etc... [/code] I wouldn't really call that a virus. Just a nuisance batch file.

Member Avatar for sknake
0
144

The End.