713 Posted Topics
Re: Row(i) can be used in a loop, so I don't think that has to be the problem. Can you debug.print or just messagebox cm1.CommandText and let us know the actual statement you try to execute. Also the actual error might help. | |
Re: You need to join to the Employee table twice (one for each name you want returned). Select a.FirstName + ' ' + a.SecondName as 'Technician', b.FirstName + ' ' + b.SecondName as 'Dispatcher' from Dispatch inner join Employee a on TechnicianID = a.EmployeeID inner join Employee b on DispatchID = … | |
Re: Use a different computer on the same network to connect to your SQL server either via code or SQL Management studio or just a DSN and test connection (or supply username/password and try to set a db as default for that DSN). I've got the feeling that your friend's SQL … | |
Re: Let's start by saying that your code will never get you logged in and it's not just the connection string. 1) You are comparing the queries you use to verify the username/password with the actual password: if Select Uname From Account WHERE UName = sing1006 can never return true (Except … | |
Re: I'm not sure I get the question. You can create accounts from your control panels "Users accounts" or if you are using AD you have to create them there. After the users have been created you set the services to run under the user you've created. If this didn't answer … | |
Re: You are leaving too much to imagine. Where are your data stored and what do you mean numbered 1 through 10000? When talking about report in VB or C# Crystal reports come in mind, do you have that in mind or are we talking about something different? | |
Re: I doubt that utrivedi's update will work since update should be followed by the table to be updated only. like this: update [rotadb].[dbo].[Rota] set [rotadb].[dbo].[Rota].[ldchangetime] = [dentime].[dbo].[den].[time] from [rotadb].[dbo].[Rota],[rotadb].[dbo].[RotaBos], [rotadb].[dbo].[RotaBa],[dentime].[dbo].[den] where [rotadb].[dbo].[Rota].[pRotaBos] = [rotadb].[dbo].[RotaBos].[Rotabos_rowid] and [rotadb].[dbo].[RotaBos].[pRotaBa]=[rotadb].[dbo].[RotaBa].[RotaBa_rowid] and [rotadb].[dbo].[RotaBa].[skod]= [dentime].[dbo].[den].[skod] But since I feel much more comfortable with the join syntax: … | |
Re: The comboboxes don't matter, it's the code that handles them. Check the code that handles the events on the comboboxes (either focus and lost focus or value changes) and the datagridview. I'm betting that you've got a logical error in your design or you are reading from your db instead … | |
Re: You can either use a uniqueidentifier to make sure that you don't have duplicate IDs in your tables or add the location in the id (01001A and 01001B). | |
Re: On your last question: You can't use collations with MS Access as far as I know. I'd suggest you change the way you approach the whole thing and use a datatable to hold your usernames. Using a datatable offers you solution to both your problems for the price of one. … | |
Re: Please note that Mitja Bonca's way of performing the check assumes that the selection limit is per user/session. If the user restarts your program then the number of times each entry is selected will be reset to 0. Also 60 is the limit per user, so for 10 users they … | |
Re: You can: * Create a global variable that will hold your username and use it whenever you need it. In your case you'd query the db for info for that username. * You can get all the info you want in the login sub and pass it to the second … | |
Re: I preffer to use session IDs for audit trails. It will ensure that you are logging out the correct session, and allows you to log users activities with only 1 unique ID that can point to a number of info that you wouldn't be logging otherwise. Usually this means to … | |
Re: So what seems to be the problem? | |
Re: I am assuming we are talking about the event in Button5: Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click If ComboBox1.Text = "First Year" Then If ComboBox1.Text = "" Or ComboBox3.Text = "" Or TextBox9.Text = "" Or TextBox1.Text = "" Or TextBox2.Text = "" _ … | |
Re: You should use a Try...Catch statement on your `sqldLoginadapter.Fill(DatasetLogin1, "empdetails")`. Read here for more info in try and catch: http://msdn.microsoft.com/en-us/library/fk6t46tz | |
Re: Can I ask what each form is supposed to do? Especially interested in the second form. Anyway, depending on the way you call the second form it might be easier to just pass these 2 values in the second form as parameters. ITG-JM and Reverend Jim are right to also … | |
Re: When this code executes is your login form open? I'm guessing that you are populating the LevelofAccessTextBox after verifying login details. Wouldn't it be easier to use a global var and be done with it? | |
Re: I haven't tried this in VB, but in VBA you can directly `Range("A1").End(xlDown).Select ` I'm guessing you could use it as `xlworksheet.Range("A1").End(xlDown).Select` | |
Re: You will need a table with movie title, url, url for picture, optional a short description (or IMDB link) and probably a status. You can query this table by either movie title, or url used for the picture or any of the other fields. | |
Re: Why don't you try RSS: http://developer.yahoo.com/weather/ or http://www.weather.com/weather/rss/subscription/ instead of website? | |
Re: I believe you are missing a space before AND in [CODE]"AND dtm = CONVERT(DATETIME,'" + cstr(Year(dtmStart)) + "-" + cstr(Month(dtmStart)) + "-" [/CODE] Same for [CODE]"AND (strRoomType='" & strRooms(0) & "'"[/CODE] Change them to have a space like " AND..." and then give it a try. If you still get … | |
Re: Store everything in that bill into tables (header and detail or more if it is required) and have your CR read the table with bill number or something as parameter. Then you can use the same CR for both occasions. | |
Re: according to your description you want strSQL = "insert into ReceiveOrder (TableNo, FoodName,Quantity,Price) select TableNo,FoodName, Quantity , Price FROM StoreOrders4 WHERE TableNo = 4" and then you need a second command that will remove the records from StoreOrders4 like this strSQL = "delete FROM StoreOrders4 WHERE TableNo = 4" Suggest … | |
Re: This seems a popular topic today. Read here how to use Try...Catch : http://msdn.microsoft.com/en-us/library/fk6t46tz | |
Re: I'd like to have more info on the tables involved (how these 2 join to each other and how they join to the tickets table). It would also be nice to give us a brief explanation on what each field means to you (don't assume we all understand the same … | |
Re: The short answer is you can't. Oracle has nested tables, but MS SQL server doesn't. If you describe why you want this / what are you trying to achieve perhaps we can find you with an alternative (like 6 columns in your employee table that you concatenate in a view … | |
Re: Give this a try update productmine set a.statusid = b.statusid from productmine a inner join productSC sc on a.code = sc.coe inner join status b on sc.status = b.status | |
Re: For me the best option would be to save it as inches. With the use of 2 functions you'll never know that you are saving in inches and you'll be able to make calculations and comparisons (is this longer than that or whatever). What you'll need is a function that … | |
Re: darkagn is correct. You need to group by all the fields that don't aggregate. You might want to take into account the number of fields you are selecting (and grouping by) together with the sum. In your statement (with the correct group by) you'll get the sum [B]per order[/B] per … | |
Re: Since your check in date is actually a date+time you can't just go ahead and say [iCODE]check_in = '3/11/2012' [/iCODE] because this translates to '3/11/2012 00:00:000' You should make sure that either your filter gets into account only the date part or filter for check_in between '3/11/2012' and '3/12/2012' Please … | |
Re: Why can't you loop through them and insert into your db? | |
Re: What file sizes/number of records are we talking about? The way I see it you can either use a macro with OLEDB and insert the records from excel or create an access db with linked tables (1 for your file and 1 for the sql server) and an insert query. | |
Re: So would Accdepartment be the next column ? And where would the female ones be shown? Does this look right: totalEmployees --------- gender -------- AccGender --------- Department ---------Accdepartment --------7 --------- male ---------- 8 ----------IT Dept --------- 5 --------7 --------- female ---------- 10 ---------- IT Dept --------- 3 --------7 --------- male … | |
Re: I don't have an SQL 2008 to test, but I'm guessing that your query fails for a number of reasons. The 1st one is that you are assigning values to variables inside the nested query. The 2nd one would be that distinct and row_number don't mix very well as row_number … | |
Re: What are you using to hold your data? It's almost always the case that dbs offer results like this a lot faster than windows (or web or console) programs will with sequential processing. By report, are we talking about Crystal reports or you need a form with 2 textboxes for … | |
Re: I'd add the number of days to the last payment and check if it's greater than today's date. (or subtract number of days from todays date and check with last payment date) PS: I've never heard of somebody getting paid every 15 working days. I've heard of every other Friday … | |
Re: What are you trying to do with this? How much volume/read-writes? You can create a trigger that will verify that your vendor_name exists in the vendor table, but that will slow down your table and in a high traffic environment it can be a problem. If the purchase_order get's handled … | |
Re: Reverend is correct. Your design needs some changes. If you need to search by name in any of the tables that don't have a name then join to the table that has it and you'll be able to. What happens if you need to search a patient with their social … | |
Re: Can you share what you've tried for enabling and disabling the account? Also, if this is a school assignment it's OK, but if you are really using this then I have to disagree with your logic for validating the username and password. What you are doing is you are retrieving … | |
Re: Like BitBlt said it can be a number of things and you need to provide info. For all we know you could be retrieving 25 rows of 12 fields of 2GB each. Or it could be a deadlock or .... Addtionally to BitBlt questions: Are you connecting the same way … | |
Re: There isn't a safe way to keep a program running not stop. The program designed like this is explorer.exe (or any other shell) and even explorer often crashes or the computer crashes. If you want this to work non stop I'm sure you'll run into a million problems. I advise … | |
Re: So what do you need? What do you want it to do that it doesn't? | |
Re: I may be wrong, but your problems (2) lie with linha When you are creating the datatable you are declaring linha, which gives it a scope within the sub. You are getting the error because you are trying to use linha outside of the sub that it belongs/exists. I may … | |
Re: Read here: [url]http://msdn.microsoft.com/en-us/library/ms187518.aspx[/url] You should focus on full outer join and before inserting, you should try with just selecting them. You might need to filter the results prior to your insert. | |
Re: Change [CODE]Dim lrd As SqlDataReader = cmd.ExecuteReader() RegisterCustomer.txtEmpIDReg.Text = Convert.ToString(lrd("Emp_id"))[/CODE] to this [CODE]dim emp as string = "" emp = cmd.ExecuteScalar RegisterCustomer.txtEmpIDReg.text = emp[/CODE] | |
Re: You can connect exclusively to an Access db (I assume from the .mdb that this is access prior to 2007) by using this connection string: [CODE]Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;Mode=Share Exclusive;User Id=admin;Password=;[/CODE] as specified by [url]www.connectionstrings.com[/url] (look up connection string for access 2007 if that's the correct version here). If you try to … | |
Re: You can easily do it with dynamic SQL. This means that you will write your query on the fly, depending on the parameters or conditions you find along the way. In your case I think this would mean: [CODE]declare @query varchar(max), @criteria varchar(max) set @query= 'select * from rm_exchange ' … | |
Re: I'm curious, why share the mdf and not connect to the SQL server? |
The End.