271 Posted Topics
Re: if you want just one row one column in return use in the select statement do this SELECT TOP 1 REGRA FROM TblUsuariosExecutive WHERE Nome = 'victor' then in the SqlCommand execute the ExecuteScalar method that will return just one value as an Object just convert that to your data … | |
Re: Hi i believe you can do this. [code=csharp] DataView MyDataView = MyDataSet.Tables[0].DefaultView; MyDataView.RowFilter = "IdCardNumber = "+Convert.ToInt32(textbox1.Text)+""; MyDataGrid.DataSource = MyDataView; MyDataGrid.DataBind(); [/code] | |
Re: if what you want is save something in a session variable do this [code=csharp] Session["UserName"] = "MyUserName"; //to retrieve String MyUserName = Session["UserName"].ToString(); [/code] | |
Re: This is what i will do, reorder these lines like this [code=csharp] string query1 = "select [B]TOP 1[/B] is_Flush from mst_csv_upload where request_name = '" + tablename + "'"; SqlCommand cmd = new SqlCommand(query1, connection_string); connection_string.Open(); string flush_flag = (string)cmd.ExecuteScalar(); connection_string.Close(); [/code] also consider that if the result set of … | |
Re: Simple, you can you web services in anything you want, the BIG Point is that if you create some web services, programmers can consume those web services with any programming language. Example, lets say you have a manufacturing company, and for some reason you want to give your customers the … | |
Re: There are few thing that i should revise here. 1. when you make a instance of the SqlCommand with the Name of the stored procedure and the SqlConnection you do not have to set the CommandText property of the SqlCommand, you can delete that line. 2. I see you execute … | |
Re: Personally i use the property enabled="False" if i want no body touch that textbox, in the only situation i use read only is when play around with gridview. regards | |
Re: First, you dont need this line cmd.ExecuteNonQuery() Second, when using fill a dataset thru an adapter you dont need to open and close the connection that is done automatically. everything looks good just take out the cmd.ExecuteNonQuery() | |
Re: If you want to do some cool stuff and does not want to mess the performance of the system, try to use javascript. | |
Re: you need to select just the age, the fact that you are grouping by name, the only time it will give you the maximum age is if you have two records example Paul 20 and Paul 40 then that will return Paul 40. but for each name will return his … | |
Re: i will assume that you are using a asp.net control button for this. [code=aspnet] <asp:Button ID="btnSave" runat="server" OnClick="Server_btnSave_Click" OnClientClick="Client_btnSave_Click" Text="Save" /> [/code] now you can add in your codebehind the Server_btnSave_Click method and in javascript write your method for Client_btnSave_Click, that way when the user click the button the first … | |
Re: You can use "SelectParameters" and then add the value of the parameter in the code behind [code=aspnet] <asp:SqlDataSource //Instance Properties SelectCommand="SELECT * FROM categorymaster WHERE catgroup in (@vgroup)"> <SelectParameters> <asp:Parameter Name="vgroup" /> </SelectParameters> </asp:SqlDataSource> [/code] then in the background you can do this sorry this is c# but vb should … | |
Re: do something like this [code=sql] DELETE FROM MAIL INNER JOIN PHONE ON MAIL.MID = PHONE.PID WHERE PHONE.PID = 12 [/code] | |
Re: 8000 records, that is definitely a lot. first: if you are saying it is mandatory to have a dropdownlist in there, then i will think a way to group the records, kind of "Category and Sub-Category", in that case you will have two dropdownlist, one to filter the other one. … | |
My Hp Lapton wont turn on at all. i took out the battery had it plug right to the AC and nothing, just can see a little light blinking next to the AC jack. that is all. | |
Re: You can try this, is the first thing comes to my mind, in your Page_Load Method do this. [code=csharp] foreach(ListItem li in RadioButtonList1.Items) { li.Attributes.Add("onClick", "CheckChange('" + li.Text + "','" + li.Value + "')"); } [/code] Then just create a javascript function called CheckChange, li.text and li.value are parameters Hope … | |
Re: Try a Inner Join like this. [code=sql] SELECT TABLE1.FIELD1, TABLE1.FIELD2 FROM TABLE1 INNER JOIN TABLE2 ON TABLE1.FIELD3 = TABLE2.FIELD3 WHERE TABLE2.FIELD4 BETWEEN 'A1' AND 'A50' [/code] | |
Re: Try to calculate that at the database level, and return the total with your result. your statement should looks like [code=sql] SELECT NAME, SCORE1, SCORE2, SCORE3, SCORE1 + SCORE2 + SCORE3 AS TOTAL FROM YOURTABLE [/code] | |
Re: above this line GridView1.DataSource = ds you are missing this one adp.Fill(ds) | |
Re: Ok in the SqlDataSource1 this part of it. "ConnectionString="<%$ ConnectionStrings:ConnectionString %>"" basically its looking the web.config file in the section ConnectionString should be a connection called "ConnectionString". verify if that is true. | |
Re: Check the selectCommand in sqldatasource id "jobSqlDS" add "Distinct" in the select statement and give it a try. | |
Re: Maybe because you have two namespace that contains the same class name on it using System.Net.Mail; using System.Web.Mail; I would try first taking out the second one because that one is obsolete, and give that a try. | |
Re: I think you are mixing two things here, i recommend you or you use javascript or c#, I see you have the selectedIndexChange method so your dropdownlist goes like this. [code=aspnet] <asp:DropDownList ID="ddlType" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlType_SelectedIndexChanged" /> [/code] Now your page load is fine but within your selectedindexchanged method just … | |
Re: In SQL SERVER I believe you can do this. so maybe that can help you to organize it in mysql it should be something similar to this. [code=sql] SELECT CUSTOMERID FROM TABLE GROUP BY CUSTOMERID HAVING COUNT(FLOWER) >= 2 [/code] | |
Hi all. originally i have this problem [URL="http://www.daniweb.com/forums/thread283467.html"]http://www.daniweb.com/forums/thread283467.html[/URL] everything works good in IE but in firefox if i try to change the dropdownlist attach to the node in the treeview it seems like at the moment i click the dropdownlist a postback is trigger and dropdownlist go back to the … | |
Hi I initially start this [URL="http://www.daniweb.com/forums/thread283467.html"]thread[/URL], but now another issue came up. Tha fact that im creating the dropdownlist in the fly within a treeview asp.net control, now i want to have one button that when pressed go thru every node in the treeview and get me the selected value … | |
Re: i see windows 7 crashing with some antivirus, in my case with endpoint protection i couldn't find a way around but install another one. | |
Re: try to use the SingeOrDefault method. like [code=vbnet] Dim owing = (From accounts In db.Accounts Where accounts.CustNumber Is current Select accounts.AmountOwing).SingeOrDefault() [/code] | |
Re: try two things. first: try to make the id parameter in the same manner as the others. second: instead of using the ExecuteReader method use ExecuteNonQuery method. that returns the number of rows affected by the query. regards. | |
Re: Can you show your code, so we can see exactly where are you stuck? | |
Re: A friend of daniweb give out a good solution. in this [URL="http://www.daniweb.com/forums/thread190891.html"]post[/URL] there are two solutions for it. the first one should work if you have MSSQL 2005 and above, the last solution will work no matter what version you have. I hope that help you. | |
Re: this is how i loaded it up. [code=csharp] rpt.Load(Server.MapPath("~/reports/myreport.rpt")); [/code] all my reports are under a folder called reports. hope that help. | |
Hi all, i have a little problem here trying to print a crystal report document using the PrintToPrinter method. This process is trigger by the event click in a asp:button control, basically i just saying this. [code=csharp] rpt.PrintOptions.PrinterName = @"PathToPrinter"; rpt.PrintToPrinter(1, false, 0, 0); [/code] this solution works fine if … | |
Re: Maybe this can help you, I am working in an intranet site and everytime i need to send something i create this static function to do it. using System.Net.Mail; [code=csharp] public static string SendEmail(string sender, string recipient, string subject, string body) { MailMessage email = new MailMessage(); MailAddress froma = … | |
Re: Is this C# or Visual Basic? second if you have separate table for doctor and patient in the consultation table you do not need to add gpname, patientfirstname, patientlastname instead you save the id for both so you table for consultation will end like ConsultationId, DoctorId, PatientId, Height, etc. I … | |
Re: Hi in this [URL="http://www.daniweb.com/forums/thread190891.html"]post[/URL] there are two solutions for it. the first one should work if you have MSSQL 2005 and above, the last solution will work no matter what version you have. I hope that help you. | |
Re: maybe this is what you are looking for Request.ServerVariables["LOGON_USER"].ToString() | |
Re: That can be done using threading, which indeed is a very deep topic but basically you can do this. [code=csharp] System.Threading.Thread tre = new System.Threading.Thread(new ThreadStart(MyFunction)); tre.Start(); System.Threading.Thread.Sleep(10000); if (tre.IsAlive) tre.Abort(); //The you have your function void MyFunction() { //Do process } [/code] There is a lot of things you … | |
I have a GridView inside an UpdatePanel set to conditional update mode and ChildrenAsTrigger to false, now the gridview got bind successfully, we are talking about 500 rows, i have others gridview but in different UpdatePanel. Everything works except when i try to clear everything, it hangs saying this: "A … | |
Re: I think you can do this. in your aspx page. [code=asp] <asp:FormView ID="fvTest" runat="server" AllowPaging="true" OnPageIndexChanging="fvTest_PageChange"> <ItemTemplate> <asp:TextBox ID="txt1" runat="server" Text='<%#Eval("id") %>'></asp:TextBox> <asp:TextBox ID="txt2" runat="server" Text='<%#Eval("part") %>'></asp:TextBox> <asp:TextBox ID="txt3" runat="server" Text='<%#Eval("rev") %>'></asp:TextBox> </ItemTemplate> </asp:FormView> [/code] in the page source call the BindForm() method in the page load or any other … | |
Re: Is that a web application or desktop app? because i think that is the default behavior of desktop app. | |
If you have 3 tables with over 10,000 records each and you have to build a recursive function with this 3 tables link, and you expect to have in return around 200 records, What will you do? "The website is intranet host" Query the sql server multiple times or load … | |
Re: Do you mean if num is decimal? in that case you can overload the function. | |
Re: Lets say that your DOB is being display by a textbox id = "txtDOB" then you can do this. [code=csharp] int years = DateTime.Today.Year - Convert.ToDateTime(txtDOB.Text).Year; [/code] | |
Re: tesuji is right but you should not group by the positionid also. | |
Re: That looks good. Just a few things to check out. 1 - The Connection String is recommended to keep it in one place, like the web.config if you are in web development or some ini file. 2 - The ExecuteNonQuery() method is a really common use one. So if you … | |
Re: Well i think I am with nick.crane you should create like a book store yourself put some table that then you can query by category, author, language, country etc. and start playing making updates etc. and then come up with more specific questions. some people like to see some real … | |
Re: Oh thats really not good, believe me I went thru that once, specially when they dont document anything or comment out. I guess you have to make sure that you can rebuild that project because some companies does not give you the whole source to modify internally, but if you … |
The End.