271 Posted Topics

Member Avatar for victortiago

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 …

Member Avatar for hirenpatel53
0
110
Member Avatar for xanawa

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]

Member Avatar for xanawa
0
98
Member Avatar for nice_candy

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]

Member Avatar for jbisono
0
61
Member Avatar for Arjun_Sarankulu

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 …

Member Avatar for jbisono
0
136
Member Avatar for suvisoya

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 …

Member Avatar for jbisono
0
97
Member Avatar for Nfurman

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 …

Member Avatar for Nfurman
0
187
Member Avatar for Shantanu88d

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

Member Avatar for Shantanu88d
0
143
Member Avatar for dougancil

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()

Member Avatar for jbisono
0
573
Member Avatar for adrianSigamoney

If you want to do some cool stuff and does not want to mess the performance of the system, try to use javascript.

Member Avatar for adrianSigamoney
0
65
Member Avatar for deolalkar_pooja

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 …

Member Avatar for jbisono
0
89
Member Avatar for Shantanu88d

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 …

Member Avatar for Shantanu88d
0
221
Member Avatar for alokshri67

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 …

Member Avatar for jbisono
0
81
Member Avatar for deolalkar_pooja

do something like this [code=sql] DELETE FROM MAIL INNER JOIN PHONE ON MAIL.MID = PHONE.PID WHERE PHONE.PID = 12 [/code]

Member Avatar for Momerath
0
146
Member Avatar for projecttoday

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. …

Member Avatar for jbisono
0
76
Member Avatar for jbisono

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.

Member Avatar for leeyn
0
368
Member Avatar for fawadkhalil

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 …

Member Avatar for jbisono
0
134
Member Avatar for WHchaz1027

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]

Member Avatar for jbisono
0
124
Member Avatar for skyboy

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]

Member Avatar for crishjeny
0
97
Member Avatar for kanuri1

above this line GridView1.DataSource = ds you are missing this one adp.Fill(ds)

Member Avatar for jbisono
0
87
Member Avatar for lilsmurf

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.

Member Avatar for kouroshnik
0
105
Member Avatar for Jesi523

Check the selectCommand in sqldatasource id "jobSqlDS" add "Distinct" in the select statement and give it a try.

Member Avatar for kouroshnik
0
135
Member Avatar for rajeshkharvi

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.

Member Avatar for jbisono
0
87
Member Avatar for daniel-brown
Member Avatar for Man44ever

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 …

Member Avatar for dnanetwork
0
85
Member Avatar for cy163

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]

Member Avatar for jbisono
0
79
Member Avatar for jbisono

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 …

Member Avatar for jbisono
0
196
Member Avatar for jbisono

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 …

Member Avatar for jbisono
0
120
Member Avatar for orion2374

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.

Member Avatar for Saver
0
526
Member Avatar for harrispc

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]

Member Avatar for harrispc
0
84
Member Avatar for BonaDrag

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.

Member Avatar for BonaDrag
0
149
Member Avatar for Jader
Member Avatar for Jader
0
146
Member Avatar for duke_swh

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.

Member Avatar for duke_swh
0
258
Member Avatar for laghaterohan

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.

Member Avatar for jbisono
0
130
Member Avatar for jbisono

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 …

Member Avatar for jbisono
0
340
Member Avatar for wm811

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 = …

Member Avatar for jbisono
0
552
Member Avatar for Izzy123

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 …

Member Avatar for ITchimes
0
74
Member Avatar for visweswaran28

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.

Member Avatar for jbisono
0
109
Member Avatar for gangaloves7

maybe this is what you are looking for Request.ServerVariables["LOGON_USER"].ToString()

Member Avatar for samkaraja
0
270
Member Avatar for chintan_1671

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 …

Member Avatar for chintan_1671
0
135
Member Avatar for manoyanx
Member Avatar for jbisono

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 …

Member Avatar for jbisono
0
225
Member Avatar for jackandjill2010

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 …

Member Avatar for jackandjill2010
0
390
Member Avatar for octavia

Is that a web application or desktop app? because i think that is the default behavior of desktop app.

Member Avatar for PierlucSS
0
296
Member Avatar for jbisono

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 …

Member Avatar for jbisono
0
105
Member Avatar for NH1

Do you mean if num is decimal? in that case you can overload the function.

Member Avatar for jbisono
0
191
Member Avatar for Roses89

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]

Member Avatar for virusisfound
0
908
Member Avatar for munna_001

tesuji is right but you should not group by the positionid also.

Member Avatar for jbisono
0
124
Member Avatar for jtok

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 …

Member Avatar for jtok
0
149
Member Avatar for Steve_Jones

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 …

Member Avatar for taylby
0
124
Member Avatar for wm811

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 …

Member Avatar for jbisono
0
154

The End.