2,245 Posted Topics
Re: [icode]int[,][/icode]: [URL="http://msdn.microsoft.com/en-us/library/2yd9wwz4.aspx"]Multi-dimensional array[/URL] [icode]int[][][/icode]: [URL="http://msdn.microsoft.com/en-us/library/2s05feca.aspx"]Jagged array[/URL] | |
Re: Please use code tags when posting code/stack traces to daniweb: [noparse] [code] ...code here... [/code] [/noparse] [noparse] [code=text] ...exception here... [/code] [/noparse] Upload your application. Its hard to tell whats going wrong without seeing code. Hit "Go Advanced" then "Manage Attachments" and it will let you upload a zip. | |
Re: As far as I know you can't do that easily. You could load one DLL in a separate app domain and access it via remoting. You could also "hack" one of the DLLs and change the version, namespace, name, etc. To modify a DLL you need the [URL="http://www.red-gate.com/products/reflector/"].NET Reflector[/URL] and … | |
Re: [QUOTE=ovycom;1107021]Hello I have same problem.[/QUOTE] Try creating your own thread in the C# forum to ask questions. | |
Re: Are you trying to store the text file as a BLOB in the database or parse the file and store values in corresponding MSSQL columns? Can you post a sample of the text file and your SQL table structure? | |
Re: You can also use the configuration file like you mentioned. You should have a "Settings.settings" file in the Properties\ directory of your solution. Add a new string value (leave the default value empty), then to get/set/save the config file: [code] Properties.Settings.Default.adminusername = "lastlogin"; Properties.Settings.Default.Save(); [/code] In the example above [icode]adminusername[/icode] … | |
Re: If that functionality exists it would be in SMO: [url]http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.backupdevice_members(SQL.90).aspx[/url] I looked around but didn't see anything at a glance | |
Re: You should consider using parameterized SQL. Take a look at this thread: [url]http://www.daniweb.com/forums/thread248513.html[/url] More threads: [url]http://www.google.com/search?hl=en&source=hp&q=site%3Adaniweb.com+%2Bsknake+%2Boledbparameter&aq=f&oq=&aqi=[/url] Code: [code] const string connStr = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\Bords\MyDocuments\Database1.accdb"; const string query = "DELETE From Applicants where Id = ?"; using (OleDbConnection conn = new OleDbConnection(connStr)) { conn.Open(); using (OleDbCommand cmd = new OleDbCommand(query, conn)) … | |
Re: Install your favorite linux distribution then install [URL="http://en.wikipedia.org/wiki/BIND"]bind[/URL]. | |
Re: [B]>> Ranx[/B] Concatenating a string in a loop like that kills performance on an application. You should use a [icode]StringBuilder[/icode] or take the approach apegram did. Every time you append a character it reallocates a new piece of memory for stringsize+1. Now for small strings you can't really tell, but … | |
Re: [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 frmListBox : Form { public frmListBox() { InitializeComponent(); } private void frmListBox_Load(object sender, EventArgs e) { PopulateDefaults(); } private void PopulateDefaults() { listBox1.BeginUpdate(); listBox1.Items.Clear(); for (int i1 … | |
Re: Take a look at [icode]CREATE AGGREGATE[/icode]: [url]http://msdn.microsoft.com/en-us/library/ms182741.aspx[/url] [url]http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=124575[/url] | |
Re: [B]>>But what I'M trying to figure out is, why is there so many different versions of the same program for so many different distributions?[/B] Its no different than windows. How often does Flash, Windows, Adobe, etc prompt you for an update? Thats a different version. In Linux the version numbers … | |
Re: Yes the dispose is needed. You also need to check the dialog result. With the code you posted it will still set the filename even if the user clicks "cancel" or "X" in the dialog. [code] private void button8_Click(object sender, EventArgs e) { using (OpenFileDialog openFileDialogPreviousData = new OpenFileDialog()) { … | |
Re: The printing behavior client side is handled by the browser and as far as I know you cannot change this behavior without writing a browser plugin. According to a post I read it is possible for some browsers but I still do not recommend it: [url]http://www.webdeveloper.com/forum/showthread.php?t=85301[/url] | |
Re: [B]>>PS: I know the below query generally work but I want to remove the redudant column (ShopCartID showing 3 times)[/B] You already have the logic for joining the three tables. You need to remove the [icode]Select *[/icode] and use [icode]Select col1, col2, col3, col4[/icode]. | |
Re: the [icode]text[/icode] datatype is for BLOBs. You can substring the data out if you inadvertently used a blob for number storage? You can probably do this in fewer operations, but to clearly demonstrate the point: [code=sql] IF OBJECT_ID('Test123', 'U') IS NOT NULL DROP TABLE Test123 Create Table Test123 ( ID … | |
Re: Check the "Output" window of your IDE to see if an unhandled exception is being thrown. That method doesn't report progress so perhaps the file is still copying? It worked fine for me. | |
Re: This should clear it up for you. I did my best to mimic your table structure and values. I think the query should explain itself but let me know if you have any questions: [code] IF OBJECT_ID('tempdb..#Client', 'U') IS NOT NULL DROP TABLE #Client IF OBJECT_ID('tempdb..#Receipts', 'U') IS NOT NULL … | |
Re: One suggestion: [code] IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[tempdb].[dbo].[#temp]')) [/code] You can replace that with: [code] IF OBJECT_ID('tempdb..#Temp', 'U') IS NOT NULL DROP TABLE #Temp [/code] Now on to your original question .. that is a lot of code. What are you trying to do exactly? … | |
Re: Can you post the offending queries? Please use code tags when posting code on daniweb: A workaround for the problem you have described has been posted on [MSDN](http://social.msdn.microsoft.com/forums/en-US/transactsql/thread/e66c9e71-4424-4cf3-920c-6725ffc40162/) | |
Re: How are you detecting if the application is running? That would seemingly be the problem here. Create a mutex when your application fires up then add a custom action in your deployment project for uninstallation that checks for the existence of the mutex then bails out. | |
Re: ... why not use the .NET framework? You can hammer the registry with reads or implement a hook to detect changes. Take a look at [URL="http://msdn.microsoft.com/en-us/library/microsoft.win32.registrykey.opensubkey.aspx"]Microsoft.Win32.RegistryKey[/URL]. | |
Re: [icode]Application.DoEvents();[/icode] is a very bad idea! :( That allows windows to pump messages in the middle of your code which leads to unexpected behavior. Invoke the messages from another thread over to your UI and let it handle the repainting. | |
Re: Why on earth would you use PSQL? Isn't that still based on the old btrieve engine? Anyway to answer your question -- As far as I know you have to create an ODBC connection and dig up a pervasive driver from somewhere and cross your fingers that it works. Do … | |
Re: That depends on what type of binding source you're using. You can call [icode]DataTable.BeginLoadData()[/icode] for example to turn off notifications while you're pulling down the cursor. Post your code or upload a sample project. | |
![]() | Re: If you catch an exception during creating/connecting an [icode]SqlConnection[/icode] you should [b]NOT[/b] attempt to instantiate an [icode]SqlCommand[/icode]. The exception could only be a bad connection string or failure to connect. Since you're specifying a user and password you should specify "Integrated Security=False" in your connection string: [code] using System; using … ![]() |
Re: What are you attempting to print? Really if you have a raw canvas or whatever spooled up on a machine to print ... and take the same print job and create a PDF document ... you could wind up with two slightly different documents. There are some limitations to the … | |
Re: No but you can hack the assembly and change it. Get the redgate reflector: [url]http://www.red-gate.com/products/reflector/[/url] Get the Reflexil, a plugin for reflector: [url]https://sourceforge.net/projects/reflexil/[/url] Then use Reflexil to change the assemblies. Its a really daunting task. I would think leaving the method signatures or version number alone would be easier. | |
Re: The [icode]ConfigurationManager[/icode] is also a handy class when it comes to access configuration files: [code] ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None) [/code] [url]http://msdn.microsoft.com/en-us/library/system.configuration.configurationmanager.aspx[/url] | |
Re: You would have to either bind those "Selection" checkboxes to a field in the datasource or do as you mentioned and re-check the values. If you're binding to a [icode]DataTable[/icode] you should be able to add another column for the "Checked" state. Just exclude that column in your [icode]DataAdapter[/icode] or … | |
Re: The application dictates where the form is drawn. When the window handle is created the app can change the boundaries/location. You could find the window handle(s) from the process you started and send a message forcing the window to be repositioned: [code] using System.Runtime.InteropServices; ... [DllImport("user32.dll")] public static extern int … | |
Re: Your file looks like a fixed-length file rather than space-delimited so I would not recommend using `Split()` but rather reading the positions. This is almost identical to your last thread except you're wanting to perform calculations. Copy the code from your last thread to read each segment of the line … | |
Re: I wouldn't suggest doing this as a 1-liner (as shown below) but to give you an idea: [code] Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click Dim s As String = "1,2,3,4,5,6,7,8,9,10,11,12" Dim avg As Double = s.Split(",").ToList().ConvertAll(New Converter(Of String, Integer)(AddressOf Convert.ToInt32)).Average() MessageBox.Show(avg) End Sub [/code] | |
Re: This topic was covered extensively in another thread: [url]http://www.daniweb.com/forums/thread246995.html[/url] Please refer to that thread and post back here if you have any more questions. | |
Re: They will be served on a first-come first-serve basis. However some connections may be slower so it is possible that the 10th hit finishes before the 1st. The webserver will handle this for you. Are you experiencing a problem or just curious? | |
Re: What you could do is stick an [icode]<iframe>[/icode] in the vbulleting page pointing it to your .NET server. It would be using two different servers but that is the only way I know of going about this. | |
Re: You could just use [icode]grep[/icode] without the find. Use [icode]grep -l -r -i[/icode] | |
Re: You can also create another directory and add it to your $PATH. [code] sk@sk:~$ mkdir bin sk@sk:~$ cd bin sk@sk:~/bin$ cat >> mycommand << _EOF_ > #!/bin/bash > echo "hello, world" > _EOF_ sk@sk:~/bin$ chmod +x mycommand sk@sk:~/bin$ pwd /home/wheel/sk/bin sk@sk:~/bin$ export PATH=${PATH}:/home/wheel/sk/bin sk@sk:~/bin$ cd .. sk@sk:~$ mycommand hello, world … | |
Re: I'm liking the new profile page :) I really like the new statistics that you are including. If you made every stat clickable that would be nice but just another feature request. For example on the "Community" tab page you have "Total Posts: N", then you could click on the … ![]() | |
Re: When does your fiscal year begin? Usually that is "week 1". I would get the week number from the fiscal year and calculate forward from the previous years base date. Some companies use "the first full week in January" for example. Let me know if this is how your company … | |
Re: Post the actual configuration files with unaltered ip/hosts and the output of when you dig the hosts you're looking up. I have helped with a number of bind setup issues and almost every time someone masks hosts/ips they make a mistake when translating to fictitious addresses. Also what do you … | |
Re: Try: [code] $query = "select * from $tbl_name where (PRINTNAME IS NOT NULL AND PRINTNAME <> '' AND Cast(PRINTNAME as varbinary) <> 0x) AND DISABLED = '0' "; [/code] | |
Re: Can you copy and paste the error message from the error dialog and post it on the thread? Please use code tags when pasting: [noparse] [code=text] ... error message here ... [/code] [/noparse] | |
Re: You can't insert text like that. If you're only talking about small code files I would load the contents in to memory, insert the text, then rewrite the entire file. If you're talking about larger files I would create a temp file with [icode]System.IO.Path.GetTempFileName()[/icode], stream the contents from the source … | |
Re: [code] --Drop our test stuff IF OBJECT_ID('dbo.sp_Test1', 'P') IS NOT NULL DROP PROCEDURE dbo.sp_Test1 IF OBJECT_ID('tempdb..#Table', 'U') IS NOT NULL DROP TABLE #Table CREATE TABLE #Table ( Item varchar(10) ) GO --Create a procedure CREATE PROCEDURE dbo.sp_Test1 WITH EXECUTE AS CALLER AS BEGIN Declare @retValue int IF (OBJECT_ID('tempdb..#Table', 'U') IS … | |
Re: This is a bad idea, by the way, but to answer your question you could do this: [code] IF OBJECT_ID('tempdb..#Table', 'U') IS NOT NULL DROP TABLE #Table Create Table #Table ( id int, period int, [sql] varchar(7000), result int ) GO Insert Into #Table (id, period, sql) values (1, 5, … | |
Re: [icode]Directory.GetFiles()[/icode] wont cut it for what you're trying to do: [code] private void button2_Click(object sender, EventArgs e) { string[] files = GetFiles(@"C:\dotnetwin\", "*.cs"); MessageBox.Show("Files found: " + files.Length.ToString()); //System.Diagnostics.Debugger.Break(); } public static string[] GetFiles(string searchPath, string pattern) { return GetFiles(searchPath, pattern, default(List<string>)); } private static string[] GetFiles(string searchPath, string pattern, … | |
Re: I usually edit /etc/network/interfaces then [icode]ifdown eth0; ifup eth0[/icode]. I'm not at a console so i'm leery of messing around with the network settings. Let me know if that doesn't work for you. |
The End.