jbisono 51 Posting Pro in Training

You can do this to display an alert.
ScriptManager.RegisterStartupScript(sender, sender.GetType(), "alert", "alert('Product Added Successfully');", true);

jbisono 51 Posting Pro in Training

In your webmethod you have this line
DropDownList ddl = (DropDownList)sender;
"sender" in this case is a button and you are trying to convert a button to dropdownlist, which that won't happen.

Change the "object sender" parameter in your function to "string pcategory" or whatever you want it to call it, and use that, you are already sending a string so there is no need to do what you are trying to do.

jbisono 51 Posting Pro in Training
<asp:DropDownList ID="DropDownList2" runat="server" style="margin-left: 75px" 
   Width="131px" DataSourceID="SqlDataSource1"    DataTextField="product_category" 
   DataValueField="product_category" AutoPostBack="True">
   <asp:ListItem>casting</asp:ListItem>
</asp:DropDownList>

Like the error says you, there is no prod_category and your datasource, so you have to change it for the real name which is product_category base on your select statement.

jbisono 51 Posting Pro in Training

Try to move the code that render the report to the Page_Init() method.

jbisono 51 Posting Pro in Training

Well I'm not sure but you can give it a try and if that fix that issue then we have a lead.

jbisono 51 Posting Pro in Training

do you have this piece of code in your load event
if(!page.IsPostBack) ? something like that, if you do comment that out and try it.

jbisono 51 Posting Pro in Training

So your report shows up? or you get the error first? also try to put a breakpoint in the page unload method just to make sure that piece of code is running when you close your page.

jbisono 51 Posting Pro in Training

Once I had that problem, I believe this piece of code did fix it, because I have never have that problem again, I actually don't like to much using Crystal Reports to many compatability issues, at least that is my experience. anyway I'm using asp.net in this is what i did.

public partial class loadreport : System.Web.UI.Page
{
   ReportDocument rpt = new ReportDocument();
   //In the load function I load my rpt "report" to the CrystalReportViewer
   //Now in my unload method I have this
   protected void Page_UnLoad(object sender, EventArgs e)
   {
      this.CrystalReportViewer1.Dispose();
      this.CrystalReportViewer1 = null;
      rpt.Close();
      rpt.Dispose();
      GC.Collect();
   }
}
jbisono 51 Posting Pro in Training

First you create your class, within your class you put your properties and methods so a class for the student will look like this.

public class Student 
{
   private string studentId;
   public string StudentId
   {
      get { return studentId; }
      set { studentId = value; }
   }
   private string courseId;
   public string CourseId
   {
      get { return courseId; }
      set { courseId = value; }
   }
   public void Registration()
   {
      Console.WriteLine(this.studentId + " - " + this.courseId);
   }
}

and then and your main function you can instantiate an object student like this

Student student = new Student();
student.StudentId = "1";
student.CourseId = "2";
student.Registration();
ddanbe commented: Well explained +15
jbisono 51 Posting Pro in Training

So you have your repeater in a contentholder and the submit button is in the masterpage, or you are saying that your repeater is in your masterpage in you have your buttons outside the updatepanel, is the last case is the option why don't you move the button inside the updatepanel? I'm not sure what is the behavior that you want to get out of it.

jbisono 51 Posting Pro in Training

Hi jlk1380, I believe you will need to open a new thread for this case, then post the link and this thread so I can find you and help you. And also is very helpful if you post the piece of code you trying to work with.

jbisono 51 Posting Pro in Training

Yes i forgot to reply back, but that works with no problem, thanks so much, and happy new year to all!!!

jbisono 51 Posting Pro in Training

Change the target to 2.3, problem fixed!!!! I guess ksoap2 has some bugs in android 4.0.

jbisono 51 Posting Pro in Training

Does anybody here have some experience calling a web service from android?

Please help. Im using ksoap2 android 4.0 thanks for any info.

jbisono 51 Posting Pro in Training

Like Antenka said, maybe this is too complex for you for now, because everything is created at runtime, which that's why you don't see anything in the design view, but if you really want to continue to play around with this code, I add some lines to meet your request, so you might be able to fix it at your needs.
Add this code:
1) In the CreatingElements() Methods

//After this line int size = 48;
//Create Panel To Hold Descriptions
FlowLayoutPanel pnl = new FlowLayoutPanel();
pnl.Location = new Point(x + (size * 2), y + size);
pnl.Size = new Size(size * 10, size * 2);
pnl.BackColor = System.Drawing.Color.LightGray;
pnl.BorderStyle = BorderStyle.FixedSingle;
pnl.Name = "PanelDescription";
//Create Labels 
foreach (var property in typeof(ElementData).GetProperties())
{
   var attribute = property.GetCustomAttributes(typeof(DisplayNameAttribute), false)
         .Cast<DisplayNameAttribute>()
         .FirstOrDefault();
   if (attribute != null)
   {
      Label lbl = new Label();
      lbl.Name = property.Name;
      pnl.Controls.Add(lbl);
   }
}
//Add Panel To The Form
this.Controls.Add(pnl);

Then for the same method

//after this line: elebuttons[el.SequenceNumber - 1].Click += new EventHandler(ButtonElements_Click);
elebuttons[el.SequenceNumber - 1].Name = el.SequenceNumber.ToString(); //This is to better retrieve the element later
elebuttons[el.SequenceNumber - 1].MouseHover += new EventHandler(Button_MouseHover); //adding the mouse over event at runtime
elebuttons[el.SequenceNumber - 1].MouseLeave += new EventHandler(Button_MouseLeave); //adding the mouse leave event at runtime

Now lets create the Event Handler for the mouse over and leave

void Button_MouseLeave(object sender, EventArgs e)
{
   //Code when mouse leave
}
void Button_MouseHover(object sender, EventArgs e)
{
   //Creating an instance of the button that was hover
   Button btn …
Antenka commented: Clean and nice .. but I guess it's just adding more confusion for an OP *giggle* +7
jbisono 51 Posting Pro in Training

Post what you have so far, and we are going to help you to finish the code.

jbisono 51 Posting Pro in Training

Good to know :)...

jbisono 51 Posting Pro in Training

for VS 2008 You can find the latest revision here: http://ajaxcontroltoolkit.codeplex.com/.

for VS 2010 try using NuGet.

jbisono 51 Posting Pro in Training

I know that in some revisions of the Ajax Toolkit there are some problems with some controls, so just double check the version that you have, and post it back.

jbisono 51 Posting Pro in Training

I copied your code, into a project that I'm working right now, and it worked right away.

You should check the version of the AjaxControlToolkit, mine is :3.0.30930.28736

jbisono 51 Posting Pro in Training

Post what you have so far, so we can correct it or add what you are missing...

jbisono 51 Posting Pro in Training

What exactly you do not understand?

jbisono 51 Posting Pro in Training

Nice BitBlt!!!!!

jbisono 51 Posting Pro in Training

When you create a new query, there is a dropdownlist right next to the Execute button to the left, which you have to select in what database you want that query to run, you have to be very carefully with this because you can create procedure against the wrong database. anyway if you didn't change that I think by default the master database is selected, so it should be in there.

Right click the Databases folder in hit refresh.

I notice that you took out the reference for Doctor Table and Patient, maybe that did not work because you were running that statement against the wrong database, try to put the references back and run that query again the right database, if you have the Doctor and Patient table created it should work fine.

jbisono 51 Posting Pro in Training

First of all, if you want to trigger a server side method, I will use a LinkButton Control instead of <a> tag.

<asp:LinkButton ID="lnkBtn" runat="server" Text="Hide Panel" OnClick="hidepanel"></asp:LinkButton>

Now in your c# code

protected void hidepanel(object sender, EventArgs e)
{
   pnl_Add.Visible = true;
   pnl_List.Visible = false;
}

if you want client side then is a little bit different.

jbisono 51 Posting Pro in Training

Change foreign key to primary key.

jbisono 51 Posting Pro in Training

Change " { " for " ( "

jbisono 51 Posting Pro in Training

Oh ok, I guess I'm sorry too for guessing!!!!

I don't do too much windows app coding, but sometimes i have to do easy stuff, and when i want to share a variable i do this.

private static string test;

public static string Test
{
    get { return ThisAddIn.test; }
    set { ThisAddIn.test = value; }
}

//Where ThisAddIn is the name of the class
//and to retrieve that info from another window
String test = ThisAddIn.Test;

//This might not be the best solution, I don't do Win app coding but that have helped me before.
jbisono 51 Posting Pro in Training

Have you tried do the binding to a HiddenField?

jbisono 51 Posting Pro in Training

Update panel are sweet in some scenarios, you don't have to do too much to add that ajax feeling to your website, but the problem is that Update Panel send the whole html back and forth, which can slow down the web page.

I will try to take out the update panel and see if you have any differences also check if you can use de cache system.

jbisono 51 Posting Pro in Training

You can try this function.

public static void Message(String message, Control cntrl)
 {
    ScriptManager.RegisterStartupScript(cntrl, cntrl.GetType(), "alert", "alert('" + message + "');", true);
 }
//NOW FROM YOUR CLICK EVENT YOU CAN DO THIS
protected void ClickEvent(Object sender, EventArgs e)
{
   Message("This is my message", this);
}

regards

jbisono 51 Posting Pro in Training

Very good!!!!, and yes when using SqlDataSource procedure such as update, select, delete, sort and paging is really easy to do, but you have less control over the GridView.

jbisono 51 Posting Pro in Training

I'm assuming that all those transaction is for one particular customer, think this is what you need, i just did it with the total column, let's keep it simple.

SELECT customer, subcat, SUM(total) AS GranTotal
FROM (SELECT DISTINCT debttable.customer, debttable.subcat, debttable.total
      FROM debttable INNER JOIN debtsum ON debttable.customer = debtsum.customer    AND debttable.subcat = debtsum.subcat) AS TEST
GROUP BY customer, subcat

I used a derived table for doing that.

Try that and see if you have your result, but I believe that you have to revise your DB Design. Let me know if you need any advise.

Regards..

jbisono 51 Posting Pro in Training

Or you can tell us what exactly is that you want to accomplish and what you have so far, and we might be able to help you in daniweb too!!!!

jbisono 51 Posting Pro in Training

Can you post your GridView Control Structure and the code you are using to bind the Grid?

jbisono 51 Posting Pro in Training

Yes, you can use Ajax Technology in ASP.NET, Actually if you are creating a website you can use Ajax no matter what is your server side code or IDE you are using. Ajax is just javascript, which can be interpreted for any browser.

Now, there are a few ways that you can implement Ajax in ASP.NET. You should let us know what exactly is that you are trying to do, and what you have so far!!!.

PS: You can read about PageMethods that will give you an Idea!!!.

jbisono 51 Posting Pro in Training

I don't quite understand your question, when you say "I want to
sum only distinct total, balance and paid", you mean that you will have two different total, two different balance, etc. So you will have a result like,

CUSTOMER  TOTAL_FROM_DEBTTABLE   TOTAL_FROM_DEBTSUM
  SOME          500.00                 250.00
jbisono 51 Posting Pro in Training

Besides what Ketsuekiame said, you can read this microsoft article, to help you maintain your code more secure.
Stop SQL Injection Attacks Before They Stop You


Good luck.

jbisono 51 Posting Pro in Training

You mean the default browser when debugging your website?

jbisono 51 Posting Pro in Training

There are a few things in your code, that personally don't like, maybe a few friends in daniweb can help you too, I don't know how important is the security for this particular application but it sounds too me that if you are trying to distinct one user from another, it is indeed important.
1) When you login, you don't say that the login or the password is wrong, you just say the credentials either the password or login are incorrect. so if that is ok then you don't need the first statement when you verify if the user exists.
2) You don't usually retrieve your password from the database instead you send the input password to the database to be verify.
If I were you I will rewrite my code like this, and that's not even good secure either.

SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["RegConnectionstring"].ConnectionString);
string cmdStr = "select User_Type from Registration where UserName='"+TextBox1.Text+"' AND passWord = '"+TextBox2.Text+"'";
SqlCommand cmd = New SqlCommand(cmdStr, con);
con.Open();
Object TypeUser = cmd.ExecuteScalar();
con.Close();
if(TypeUser != null)
{
   Label1.Visible = false;
   Label1.Text = "";
   if(TypeUser.ToString() == "Administrator")
      Response.Redirect("Administrator.aspx");
   else
      Response.Redirect("StaffMember.aspx");
}
else
{
   Label1.Visible = true;
   Label1.Text = "Invalid Credentials Entered, Try again";
}

assuming you just have two types of users.

jbisono 51 Posting Pro in Training

First that is happening because you are not linking your two tables with a particular field, if that is what you want I would say SELECT TOP 1 THE REST OF THE CODE HERE.

But this is what I think you need and the FROM Clause Remove everything and add this
PTable AS T1 INNER JOIN
MTable AS T2 ON T1.idNumber = T2.mNumber

I'm assuming that idNumber and mNumber is the same ID. that should work.

jbisono 51 Posting Pro in Training

Maybe your computer could be infected, have you tried to scan your computer with some virus removals?

jbisono 51 Posting Pro in Training

I think you are missing to select another field "dis_wing"

select IFNULL(max(count(dis_rowno)),0) as maxcolspan, dis_wing from xyz

Try that and let me know...

jbisono 51 Posting Pro in Training

Don't mention it!!!

jbisono 51 Posting Pro in Training

If you dont want to filter out just the items that does not have a -U then you can do this. I'm assuming that the '-U' is always at the end.

SELECT CASE WHEN SUBSTRING(ItemNumber, LEN(ItemNumber) - 1, 2) = '-U' THEN ItemNumber ELSE ItemNumber + '-U' END AS MyNewItemNumber
From YOURTABLE
jbisono 51 Posting Pro in Training

The problem with your statement adam is that ROW_NUMBER() is not supported by SQL 2000, but besides that I like your statement better :-) ....

jbisono 51 Posting Pro in Training

This is what I would do. Imagine you have table "Employee" with this two fields FirstName, LastName then you can do this.

SELECT FirstName, LastName, RowNumber
FROM(
SELECT Emp.FirstName, Emp.LastName, (SELECT COUNT(*) FROM Employee AS Emp2 WHERE (Emp2.LastName < Emp.LastName)) AS RowNumber
FROM Employee AS Emp) AS derivedTable
WHERE RowNumber >= 11
ORDER BY RowNumber
jbisono 51 Posting Pro in Training

Ok, let me see if with this example i can help you. When you use any aggregate function, in this case I see you are using "MAX", and you are selecting more fields that does not have an aggregate function, you have to group by those fields example.

SELECT MAX(TargetEventDate) AS TargetBidDate, ProjectID
FROM YOURTABLES
GROUP BY ProjectID

In the above example the "TargetEventDate" is in an aggregate function "MAX" but the projectID does not. so you need to Group By those extras fields that does not have an aggregate function...

Got it?

jbisono 51 Posting Pro in Training

Can you post the full statement?

jbisono 51 Posting Pro in Training

You are missing a parentesis

ISNULL(MAX(ProjectOverview.[Target Event Date - Date]), 'INACTIVE') AS [Target Bid Date]