- Strength to Increase Rep
- +7
- Strength to Decrease Rep
- -1
- Upvotes Received
- 13
- Posts with Upvotes
- 11
- Upvoting Members
- 8
- Downvotes Received
- 7
- Posts with Downvotes
- 3
- Downvoting Members
- 7
Re: The above post is correct. I want to add when you use arraylist of objects, the public properties of the objects in that arraylist are similar to columns of your SQL queried data. | |
Re: I came searching this thread because I found my power to affect someone's reputation is +/- 1. I also observed that some other newbies have less posts or solved less problems and got more points. The only thread I got negative, in my honest opinion, are from idiots to put … | |
Re: 2 things I can think of: 1. What is data type of h? 2. Is the result "Hits from Admin" null if you run the query (like in SQL query analyzer or Management studio)? I would try something like this [code=c#] int iHits = 1; if (dr["Hits"] != DBNull.Value) { … | |
Re: There are 2 steps: 1. declare parent page (superclass) [code=c#] public class ParentPage : Page { protected override void OnLoad(EventArgs e) { objLoginUser = (Users)Session["LOGINUSER"]; if (Session["LOGINUSER"] == null) { // you got no logged or session expired...refirect etc. } //end if } } [/code] And other step is [icode] … | |
Re: There is some wiered solution I got in mind. See if it works. [code=sql] alter table your_table add column tmpSno int identity(1,1) Go update your_table set ID = tmpSno Go alter table your_table remove column tmpSno Go [/code] Get the idea, the syntax might need re-checking Close this if it … | |
Re: Is there a chance of using hyper link? One or all your columns could be hyperlinks and the link itself would be something like [code=ASP] <a href='newWebForm.aspx?key=' <%= bind-key %>'>your column data</a> [/code] Other is, since you are handling color change to show current selected row, you are already handling … | |
Re: I would like to see stack trace and the corresponding source code with line numbers. Make sure .PDB file is latest. I guess it is not easy to reproduce, otherwise debugger would have helped. | |
Re: I wouldn't rely on @@rowCount. Plus, logic for user login / email looks "liberal", one can enter valid login and invalid email. My preferred logic would be: [code=sql] ALTER procedure [dbo].[users_login] (@username varchar(50),@password varchar(50), @emailid varchar(50),@ret int output) as begin set @ret=0 if @emailid <> '' or @username <> '' … | |
Re: There are few suggestion for the post itself. I cannot see the reason for lot of blank lines. Because of that it is very discouraging to try reading the code. User Code tags, edit queries. Actual DB related GENERAL suggestions 1. reduce the size of your variables, though they are … | |
Re: Given relational database normalization, you should not do that. What you do is join Sale and Code tables in your select statement. [code=SQL] Select c.code, c.product from code c inner join sale s on c.code=s.code [/code] However for some reason you do want to update the SALE table, just for … | |
Re: [QUOTE]SELECT HomePageSectionDescr,URL FROM HomePageSectionT System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections.[/QUOTE] Which means your database is either … | |
Re: Check if there is divide by zero because TextBox3.Text is blank or 0. Write you if upfront for that. In addition, simple int might not be large enough, but that doesn't seem to be the current error. please mark thread closed if this helps. Otherwise post your solution if any. | |
Re: The above query by apegram is in general good, except for sort by cost. Typically if there was credit or discount (negative cost). Also grand total shows ugly harcoded custID. The solution is slight modification to the same, though credit goes to apegram for writing the workable query. [code=sql] select … | |
Re: I assume you got a form that has City text box, say its [icode] <input ID='city' valye='' name='city' /> [/icode] Now your sql need to be [CODE] sql= "select count(city) as cx from NY where CITY='" & request("city") & "'" [/CODE] Please check / correct syntax. I am kind of … | |
Re: In addition, as adatapost suggested above, clarify the search requirement, such as what is that the user is searching? Your database? Your site? All of net? Of course once you try and you share your code, others can discuss further. | |
Re: I am not sure how you are loading the dataset that has previously purchased products for the customer. Can you pass that customer ID as parameter and re-query that in you query and use something like [icode] ShopCartItem.ProductID not in (select ProductID from pastPurchase where custID=@custID) [/icode] May be there … | |
Re: There are so many errors with these, that I don't know how to correct all of it. There are 9 instances, I got tired after 7 I have pointed for some help. Looks like this is your homework. I wonder if it is even Ok to help you. anyway here … | |
Re: Assuming you want order by date (SQL server 2005 or higher) [code=sql] select row_number() over (order by [date]) as serNo, * from ( SELECT [date], SUM(Qty) AS Qty, FROM mytable GROUP BY [Date] ) t [/code] For SQL 2000, stored proc with temp table with auto increment column [code=SQL] create … | |
Re: From the code snippet it is not clear to me if the [icode]asp:TextBox ID="IDNum"[/icode] is part of edit template or not. Also it is not clear if your question is related to DB operation or reading data from page or both. If it is not part of grid's edit template … | |
Re: first doc it to say right hand side by pulling the dialog title bar (here the blue bar that says Solution Explorer), click and hold and drag to one side where there will be an arrow like image will appear once you do this. Or double click on the title … | |
Re: I am not sure how the whole thing is supposed to work, but it being Java, indexes are 0 relative. try this [code=java] if (rs.last()==false){ tabel.setValueAt(rs.getString(0), 0, 1); } else { tabel.setValueAt("", 0, 1); } [/code] Close the thread if this helps | |
Re: Depending on events (like _RowCancelingEdit or _RowEditing) you want to use true or false for ShowFooter. [code] gv_Money.ShowFooter = false; [/code] Please mark as solved if this is sufficient. | |
Re: try this [code] int returnVal = 0; if (rdr[0] != DBNull.Value) { returnVal = Convert.ToInt32(rdr[0]); } [/code] I wonder how VS did not give you auto suggestion for this. | |
Re: I find [URL="http://www.fluffycat.com/"]http://www.fluffycat.com/[/URL] very helpful. I hope it helps you too. | |
Re: I can think of a sotred proc, where you will generate a temp table of 1 column and insert 1 .. max(sno) and then delete existing. [code] create table #tmpNum (id int) declare @mx int select @mx=max(sno) from table1 while @mx >= 1 begin insert into #tmpNum values (@mx) set … | |
Re: I would personally prefer a console application, not windows application. If you have main logic code extracted outside of form, you can easily put together a console app. However I do expect WinForm to have .visible = False possible. Problem is on what event of the form are you expecting … | |
Re: Would you rather subtract 52 weeks from your @LastBusinessDay? Because, even if today was Wed Jan 13 2010, Last year Jan 13 is Tue. [icode]select dateadd(wk, -52, getDate())[/icode] See if this is better? If it helps lets close this thread. | |
Re: If this is stored proc, it is sure simple. [code] SET @returnValue = 0 SELECT @returnValue = 1, item FROM TABLE -- @returnValue = 1 means there were records in the table [/code] if you want this as part of one query, I would like to know how you are … | |
Re: I think above anser is missing one point: [QUOTE]In the period field, there is time interval for the query to run.[/QUOTE] Assuming certain limitations, given below, other solution is to write stored procedure (as given above) and schedule it as a SQL server job. Limitation 1: you need to know … | |
Re: I feel current structure is enough, if a country has no sea-border, there will be no record in SEA_BORDER for that country. As far as database is concerned your current structure is perfect. When finding countries with/without border with sea etc, you need to write correct SQLs (selecs). |