713 Posted Topics
Re: Accept the facts friends. There is no magic ring to rule them all. It's just the right tool for the job. Be it SQL or Java or VB there the industry has work for all languages exactly because each one is the right tool for something. Hell you can make … | |
Re: debasisdas is correct as usual, but may I ask what data types are the 300 columns? If 200 columns are text fields (or any other large data type) and you want them to be searched for some text this might be a challenge for the "hundreds of millions" records. This … | |
Re: I guess it depends on the topic. I don't see how it would help someone to see me type a VB .Net program for them (oh wait it might make it easier to see the changes). I believe that it will take for ever to set up a video recording … | |
Re: You need to show your code. We can't help you if we don't know where you are holding the food type or the quantity or where you want the results. Also you need to show that you've tried. Show your form and explain a bit better what you are trying … | |
Re: This is an easy way to do it: [CODE]SELECT DISTINCT SP.ANALYSIS AS Analysis,COUNT(SP.ANALYSIS) AS Amount, sum(case when SP.RESULT = 'POS' then 1 else 0 end) AS POS_Count FROM SAMPLE S INNER JOIN SAMPLE_PARTS SP ON SP.SAMPLEID = S.SAMPLEID WHERE S.SAMPLE = '18000' GROUP BY SP.ANALYSIS[/CODE] PS: I'm using sum instead … | |
Re: Even if you do rename it, the protocol and the settings will be all wrong (Xon/Xoff instead of Bit, Parity, Speed, etc). I think rubberman is right find another application or try to connect your CNC machines via COM if there is such an option. PS: You are saying that … | |
Re: You need to change the datasource from your form to a join like this: [CODE]select [Staff Salary].[Staff ID], [Staff Salary].[Basic Salary], [Staff Table].[Staff Name] from [Staff Salary] Left Join [Staff Table] on [Staff Salary].[Staff ID] = [Staff Table].[Staff ID] [/CODE] PS: You shouldn't have a Staff Name in the Staff … | |
Re: [CODE] For i = 0 To DataGridView1.Rows.Count - 1 DataGridView1.Item(0, i).Value = Mid("11DCE000", 1, 8 - (i + 1).ToString.Length) + (i + 1).ToString Next [/CODE] | |
Re: [QUOTE=Netcode;1657756]What database? If MS SQL, you can simply use the below query [CODE]Dim StringCount as string = "SELECT COUNT from CourseEnrolled where Course_ID IN (csc01,csc02,csc03)"[/CODE][/QUOTE] Did you mean [CODE]select count(*) from CourseEnrolled where Course_ID = 'csc01'[/CODE] ? | |
Re: urtrivedi's script should work, provided that the where is : [CODE]where year(datecolname) = '2011'[/CODE] or something similar. | |
Re: You can (and should) encrypt it. If you encrypt it as a file (versus just the contents) then users won't be able to copy/paste it to another computer (except when using Ghost or similar software). | |
Re: Not only you are not showing effort, but you are not providing enough to go on. Your 2 tables cannot be joined with the fields that you are providing. Also how do you define top buyers? By quantity, money, number of contracts ? | |
Re: if num is always 1, isn't your program stuck in an infinite loop? Anyhow, I just want you to know that you can't possibly write a security module for your app in .Net. No matter what you do - keys, internet authentication, encrypted files or whatever .Net offers next to … | |
Re: There isn't a way to do what you are asking. LIKE won't work since you are looking for <=. What you can do based on your sample is substring like this: [CODE]select * from log where convert(int,substring(log,4,2)) <= 7[/CODE] You also can try your luck without the conversion to int. | |
Re: Read here: [url]http://support.microsoft.com/kb/312897[/url] | |
Re: Please show what you've developed so far and where you are having trouble. Thanks. | |
Re: it's actually pretty simple. Create a sub with the code you've used to populate the datagrid in the first place and call that sub whenever you want to load data into the datagrid (on form load, after an insert/update/delete or on a button click event). | |
Re: [QUOTE=LaxLoafer;1633036]Wow, that's amazing! Even if the headline was true, would the increase in processing power make a perceptible difference? When we went from 16 MHz to 32 MHz processors, the performance boost was immediately apparent. Tasks that might have taken 1 minute only took half that time. My human brain … | |
Re: How do you store your connection string? There are a number of ways to store the connection string and it some of them you can include it to the project (settings, xml or ini file, or even registry values that you create in your code if they are not present). | |
Re: You've said database, which makes me wonder what happens when today = fromdate. Are you be going back to the database and checking for something? What db are you using? | |
Re: Why can't you do it with conditional formatting (or a macro that set's conditional formatting? for example conditional formating rule for range O50:O57 when value between =max(O50:O57) -2 to = max(O50:O57) To handle the cells with strikethrough it will be a bit hard, but it can be done from VBA. | |
Re: This will add a user to the sysadmin role: [CODE]EXEC master..sp_addsrvrolemember @loginame = 'username', @rolename = N'sysadmin'[/CODE] Hint: If you have MS management studio you can create a user with all the roles (db or server) and instead of hitting OK you select Script from the top of the window … | |
Re: What BitBIt is saying is absolutely correct. SQL server is build to manipulate multiple records simultaneously and that's when it will show it's true potential. Back to your problem: The reason why you only get 1 record updated is the use of variable. The variable can hold 1 result and … | |
Re: It is possible to format your report to show the field names in 1 column and the results in another. If you use the wizard, select columnar layout and it will do it for you or go into design view and drag and drop the fields and their labels in … | |
Re: Nope, debasisdas has it correct. If you want all events that started AND ended between a certain period you need to use AND. OP states it [QUOTE] Not use between. Because some event maybe began on 10/9 but end date is over 15/9. So use between can not find out … | |
Re: I really don't understand what the question is. There are a million possibilities for your result sample: [CODE]select employee.emp_id,employee.Emp_Name,attendance.Time_In,attendance.Time_Out from employee inner join attendance on employee.emp_id = attendance.emp_id and time_id = '' and time_out = '' [/CODE] [CODE]select attendance.emp_id,attendace.Emp_Name,attendance.Time_In,attendance.Time_Out from employee left join attendance on employee.emp_id = attendance.emp_id where attendance.emp_id … | |
Re: I haven't really used this, but if I remember correctly you should use something like: [CODE]for each ctrl as Control in Me.Controls if typeof ctrl is textbox then 'your code here end if next [/CODE] I'm pretty sure you can also check the name of the control, I'll look it … | |
Re: Is your database called ADODB ? Check your connection string here: [url]http://www.connectionstrings.com/[/url] | |
Re: Also a good advice is to not trust the next or the previous layer and always verify then input. After all even encrypted dbs in the most secure environments can be cracked open with SQL injection. | |
Re: The TOP will result in only 1 record from the entire query. If you want all esns - whatever that is - with the supplierid and the latest shipdate then you must use something similar to: [CODE] Select vp.esn, us.supplierid, us.shipdate From Table1 as vp with (nolock) Left Outer Join … | |
Re: Cross join without a where is supposed to deliver a cartesian product: [url]http://msdn.microsoft.com/en-us/library/ms190690.aspx[/url] You should join your tables using keys that will make unique joins record to record from one table to another. You could find that the same result is for now achieved using a distinct ie: [CODE]select distinct … | |
Re: If your loop is working, perhaps your problem is not the loop, but the way you read data from your datagridview. Please post what is inside the loop. | |
Re: The checkbox.checked (=True or False) is a pretty good way. [CODE]"insert into table (field1) values ('" & checkbox.checked.tostring & "')"[/CODE] | |
Re: You will need to explain a bit your requests. By altering multiple columns, you mean update? Will the columns be fixed or are they to be passed as parameters (if this is the case, will the table also be a parameter?). Will the proc accept criteria as a value to … | |
Re: If you need the sproc to fire every time the table gets updated, why don't you use a trigger? As for the single portfolios, add STR_BRANCH_BB618FB1 to your select and group by. PS: Good luck remembering table and field names. | |
Re: This might be silly, but: How is your combobox getting it's values? Could it be that you've got a background worker or something running when you are checking for row(0) and the msgbox is just giving the necessary time for the operation to complete? | |
Re: I've seen good and bad implementations of both solutions. How many records are we talking about? Is there a need to insert records before the "last" (either retrieve something from archive or a delayed insert from a mobile client) and how often? There are a number of parameters for going … | |
Re: Why use VBA? This is a pretty simple query, which can run as a query and update or show or whatever. You can create a new query from Query Design and instead of selecting tables and fields, switch to SQL view and put in [CODE]Update table_name Set col_name = Right(col_name, … | |
| |
Re: Usually when we set AutoGenerateColumns = False we plan to create the columns manually. [CODE]DataGridViewSearchPrev.columns.add( column )[/CODE] You wouldn't have a reason to do so, unless default doesn't cover your needs (i.e. you might want combobox as a column) | |
Re: Subquery without the aggregate and aggregate the results: [CODE]select field1, sum(field2) from (select field1, field2 from table1) a group by field1[/CODE] Just make sure that you've named all your fields in the subquery. | |
Re: [CODE]select * from (select FirstName, LastName, ROW_NUMBER() over (order by LastName,FirstName) as 'Row' ) a where Row >=11 [/CODE] Pretty much the same thing as jbisono's query. | |
Re: If your table contains different dates with different status for example and you group by status - or any other field for that matter - then you won't get the "latest version" of your project. You will be getting the maximum date per unique record. If this is not what … | |
Re: If a user joined Jan 30th, then what would the due date be for February? If I join tomorrow (Sep 31st)? It can be a tricky business to calculate dates on your own, but you can create a string with the day, month and year that you like and convert … | |
Re: If your Cast is working, then I don't see a problem. [CODE]Select ItemNumber, PurchasePrice, ReceivingPO, DATENAME(d,Cast(ReceivedDate as Datetime) as ReceivedMonth) as 'Day' -- Change d to whatever you need. From #VPTable as vp Where vp.ReceivingPO is not null[/CODE] | |
Re: [CODE] SELECT moncallAdd.FirstListing, DATEADD(MINUTE, mOnCallAdd.StartOnCallTime, DATEADD(DAY, mOnCallAdd.StartOnCallDate, '12/31/1899')) AS OnCallStart, DATEADD(MINUTE, mOnCallAdd.duration, DATEADD(MINUTE, mOnCallAdd.StartOnCallTime, DATEADD(DAY, mOnCallAdd.StartOnCallDate, '12/31/1899'))) AS OnCallEnd, 'Added' As Activity FROM mdr.dbo.mOnCallAdd WHERE DATEADD(MINUTE, mOnCallAdd.StartOnCallTime, DATEADD(DAY, mOnCallAdd.StartOnCallDate, '12/31/1899')) < GETDATE() and DATEADD(MINUTE, mOnCallAdd.duration, DATEADD(MINUTE, mOnCallAdd.StartOnCallTime, DATEADD(DAY, mOnCallAdd.StartOnCallDate, '12/31/1899'))) > convert(char(10),GETDATE(),101) -- 101 is US format, as is your … | |
Re: I don't have an SQL available now to test it with text fields, but try to [CODE]select col1,col2,col3,col4,count(*) from table1 group by col1,col2,col3,col4 [/CODE] If you don't want the count(*) in your results, use it as a derived query as so: [CODE]select col1,col3,col3,col4 from (select col1,col2,col3,col4,count(*) as 'counter' from table1 … | |
Re: This is just an advertisment for his site. Don't waste your time. | |
Re: I think GeekByChoice explained that we won't write the program for you here: [url]http://www.daniweb.com/software-development/vbnet/threads/379364[/url] |
The End.