2,245 Posted Topics
Re: [code] IF OBJECT_ID('tempdb..#NewOrders', 'U') IS NOT NULL DROP TABLE #NewOrders IF OBJECT_ID('tempdb..#Parts', 'U') IS NOT NULL DROP TABLE #Parts Create Table #NewOrders ( PartId varchar(10) PRIMARY KEY, number_of_parts int ) Create Table #Parts ( PartId varchar(10) PRIMARY KEY, [Description] varchar(100), Cost money ) Insert Into #Parts (PartId, Cost, [Description]) Values … | |
Re: Have you reviewed the windows event log for error message? IIS is usually pretty good at spitting out errors. | |
Re: [B]>>"the second time I cannot delete all table to import it again from the beginning because of these extra fields"[/B] What are the extra fields? This is going to be a very processor intensive task :) Depending on what the data looks like and the type of comparisons you need … | |
Re: Your file has 6 fields in it and you only gave 5. I'm guessing you left the tax rate out. Can you give an example of one line of sample data, all of the calculations, and the expected output? | |
Re: Try posting your code here so we can see the issue. Be sure to use code tags: [noparse] [code] ...code here... [/code] [/noparse] | |
Re: That error explains it. Your column count does not match your value count. >>insert into users(u_UserID, u_Name, u_lastName, u_Address, u_Tel, u_Notes, u_Email) 1. UserId 2. User Name 3. Last Name 4. Address 5. Telephone 6. Notes 7. Email >>txtUserID.Text + "','" + txtName.Text + "','" + txtLastName.Text + "','" + … | |
Re: Jerry -- I'm not knocking on your example, it was great, I just wanted to point one thing out: [code] if( OnTimelineRecieved != null ) { TimelineArgs targs = new TimelineArgs(myobject); OnTimelineRecieved(null, targs); } [/code] Technically some believe that is not "thread safe" because in the time between checking if … | |
Re: I agree with seeing *who* upvoted/downvoted a post but if that were implemented then it would be more or less the same as the reputation system. Its just a matter of time before someone does "Find all posts by...." and starts downvoting | |
Re: Be sure you watch out for spaces in filenames. They are valid and it may break your parser depending on how it is implemented. | |
Re: I don't understand what you are asking .. and since a few days have passed and nobody has attempted to answer your question i'm guessing they are in the same boat. Can you please clarify? | |
Re: File size? Resolution? By distort I assume you mean scale? If you want to maintain the aspect ratio and not distort you could size it evenly but then you would have to crop images that "dont fit" your model of size. You haven't provided nearly enough information to help you … | |
Re: You should invalidate the region of the form being drawn (your panel) and let windows handle the refresh. It is slightly more expensive to cause a redraw of the entire form or forcing a refresh. The operating system does the minimal amount of repainting. It really shouldn't matter for something … | |
Re: The mouse position is in pixels which is relative to the display settings on the display adapter. You can do the math yourself to convert the values. Can you upload a sample project demonstrating the drawing unit where you want to snap the cursor? You may be better off drawing … | |
Re: I don't understand what your code is doing. You are making 2 calls to [icode]openFileDiag.ShowDialog()[/icode]. Try something like this: [code] private void button2_Click(object sender, EventArgs e) { using (OpenFileDialog openFD = new OpenFileDialog()) { openFD.Title = "Insert an image "; openFD.InitialDirectory = "c:"; openFD.FileName = ""; openFD.Filter = "JPEG Image|*.jpg|GIF … | |
Re: Can you upload a small sample project demonstrating this behavior? Include a data file that is being translated and the libraries required to compile the project. This could be an encoding issue but its hard to say since you're doing transformations on the data. | |
Re: That looks like code from the twitter API sample I posted some time back ;) Depending if you have changed it or not you do not want to catch the exception in this method. Here is the original code: [code] new Action<Stream>(BeginRead).BeginInvoke( response.GetResponseStream(), new AsyncCallback(EndRead), null); ....... private void BeginRead(Stream … | |
Re: >>"here I need logic/code to get the data direclty to our Application/Server" Getting data directly from the application server depends on how the data is presented. I'm afraid you haven't provided enough information for someone to answer you at this point. Can you explain the project a little more? | |
Re: You need to specify Insert, Update, Delete, and Select queries for your data adapter. | |
Re: Probably not except by brute force. This is a bad idea though since when the user loses their cookies they will no longer be able to log in. It is just a matter of time before they lose their browser settings. | |
Re: Post the code where you are executing the [ICODE]select * from table[/ICODE]. There are a number of ways to go about this. | |
Re: [code] Select FriutID from Friut where friutName like (@con + '%') [/code] | |
Re: There is a few samples of various chat systems on code project. Here is one example: [url]http://www.codeproject.com/KB/IP/TCPIPChat.aspx[/url] In the case of p2p just make a single application and either user could be the server or client. Whoever initiates the conversation will be the server and the other is the client. … | |
Re: Can you upload a project and sample excel file? I'm having trouble envisioning the task you're describing... | |
Re: This sounds like a firewall issue. Your listener could also be set to listen on 127.0.0.1 and not all available IPs. I have very little faith in opening a socket like you have in your example, but i see people do it all the time: [code] IPHostEntry ipHostInfo = Dns.Resolve(Dns.GetHostName()); … | |
Re: JPEG is a lossy format. You can pick another image format to save the image. Or do you have something else in mind? | |
Re: Are your tables indexed properly and are the transactions completing and closing? Have you ran the query in the SQL Query analyzer with statistics enabled? Is your web application [b]using parameterized SQL[/b] or are you building the queries dynamically? How many rows are in the underlying table that [icode]udfn_Distance[/icode] checks? | |
Re: Like this: [code] HtmlDocument doc = (Webbrowser.Document as HtmlDocument); HTMLObjectElement FirstElm = (doc.All[0] as HTMLObjectElement); [/code] Or: [code] HtmlDocument doc = (HtmlDocument)Webbrowser.Document; HTMLObjectElement FirstElm = (HTMLObjectElement)doc.All[0]; [/code] | |
Re: What does your SP do? Does it return a cursor (does it have a Select query inside of it?) or are you just trying to get the integral return value of the sproc? | |
Re: You need to specify a Select, Insert, Delete, and Update query for your data adapter. You also need to call .Update() on your data adapter after you add, edit, or delete a DataRow in your DataSet/DataTable. If you modify a row then re-fill your dataset you're blowing away the changes. | |
Re: >> "I get errors that another thread is using the textwriter" You can only have a file open once. If two threads open the textwriter to the same file you'll start seeing those errors. What you need to do is funnel all of the File I/O operations through a single … | |
Re: I see a problem right away with garbage collection in your code. Take this portion of your code: [code] SerialPort sp; private void Form1_Load(object sender, EventArgs e) { string[] sps = SerialPort.GetPortNames(); foreach (string pname in sps) { sp = new SerialPort(pname); } [/code] Now lets expand it to something … | |
Re: sharathk60, I believe the solution Daniel provided will fix your issue. If it doesn't then please post the [icode]CREATE TABLE[/icode] statement for your table. | |
Re: I found these steps on a site: [QUOTE] 1.From the command line, type sudo su to get root privileges. 2.nano /etc/apache2/mods-available/speling.conf 3.Type CheckSpelling on and hit ctrl-x, y to exit and save the file. 4.type a2enmod and then speling and hit enter. 5.type /etc/init.d/apache2 reload to reload apache. 6.Mistype a … | |
Re: If you have uninstalled it then [icode]rm -rf[/icode] the directory to erase the data and reclaim the hard drive space. | |
![]() | Re: [QUOTE=Kristofferson;1016307]Well what I did earlier is set my UPDATE statement to [CODE]Update Employee Set Phone = "" [/CODE] Just to see if the the update statment syntax was correct. It worked it effectively erased the entire Phone column. Wouldn't that mean that I can write to the database?[/QUOTE] Yes that … |
Re: I don't have a flag bad post link either on snippets. I wanted to flag [URL="http://www.daniweb.com/code/snippet231856.html"]this snippet[/URL] | |
Re: See this thread regarding sound and beeping: [url]http://www.daniweb.com/forums/thread231020.html[/url] [code] Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Console.Beep() Dim sp As New System.Media.SoundPlayer("C:\filename.wav") sp.Play() sp.Dispose() End Sub [/code] | |
Re: Here is an example of running the code in another thread: [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.Collections; using System.Runtime.Remoting.Messaging; namespace daniweb { public partial class frmQuickSort : Form { public frmQuickSort() { InitializeComponent(); } public static int … | |
Re: Usually you want to close and dispose a socket or listener and create a new instance. In some cases sockets cannot be reused. Can you post the relevant code where you are having these issues? | |
Re: If you have port forwarded both ports and one works fine it sounds like a problem on the webserver. Can you connect to the webserver internally using https? Post your apache config file here as well as the output from `iptables-save `(run that command as root). Please use code tags … | |
Re: Do you have to register the font? I have seen code snippets before that use unregistered fonts. [code=c#] // Be sure to dispose your PrivateFontCollection // and Font to avoid an easy leak! System.Drawing.Text.PrivateFontCollection privateFonts = new PrivateFontCollection(); privateFonts.AddFontFile("mycustomfont.ttf"); System.Drawing.Font font = new Font(privateFonts.Families[0], 12); this.label1.Font = font; [/code] [I]Borrowed … | |
| |
Re: Main form: [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.editform { public partial class frmMain : Form { private DataTable _dt; public frmMain() { InitializeComponent(); } private static DataTable GetData() { DataTable result = new DataTable(); //nr,date and obs … | |
Re: [code] private void button1_Click(object sender, EventArgs e) { string domainAndUser = @"system\admin"; string[] sArray = domainAndUser.Split(new char[] { '\' }, StringSplitOptions.None); string domain = sArray[0]; string user = sArray[1]; Console.WriteLine("Domain: " + domain); Console.WriteLine("User: " + user); } [/code] Results in: [code] Domain: system User: admin [/code] | |
Re: You can use [URL="http://msdn.microsoft.com/en-us/library/ms151198.aspx"]sql replication[/URL] to replicate the database from one server to another. | |
Re: It sounds like you're on the right track. You know what you need to do so I don't understand what you're asking. If you have a specific question about creating a dataset or its' behavior then please update the thread with your question. | |
Re: DdoubleD is right. To elaborate more on the issue take this for example: [code] string s; s += "abc"; [/code] Now you're appending a value to s, but what is s? It was never assigned a value thus you have the problem. What you can do: [code] string s = … | |
Re: [code] Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Dim p As New System.Diagnostics.Process() p.StartInfo.FileName = "C:\\test.bat" p.Start() End Sub [/code] You can also call [icode]p.WaitForExit()[/icode] if you want your application to hold up until the bat file is done running. | |
Re: What error message do you receive.......? | |
|
The End.