0

I have this ajax request.

 $.ajax({
                type: 'Post',
                dataType: 'json',
                contentType: "application/json; charset=utf-8",
                url: 'https://********/***/*******.asmx/Login',
                data: "{ userID: '" + userName + "', pwd: '" + password + "' }",
                success: successCallBack,
                error: failureCallBack
            });

Problems is this works fine in older chrome browser. Eg. 20.XX.XX
But it does not work on new chrome browser. Eg. 31.0.1650.57 m

When i remove dataType: 'json',
contentType: "application/json; charset=utf-8", lines in chrome 31.XX browser gives me response as a plain text.
Please help me to figure out how to resolve this issue.

i.e. The web service works fine

0

I am using

StingBuilder.append("Address : {0}, {1}, {2}  {3} \n",
                    Street1,
                    Street2,
                    PostalCode,
                    City);

Problem is if Street1 or street2 is null String builder returns

, ,code,city. 

I want to remove those commas(,) as well. how can i do that?

Thank you in advance.

0

I have two web services added to the project. One is real web service. Other one is test webservice. i have used them to set some parameters.

eg: WS.OrderDescription 
    WS.Amount
    WS.OrderNumber
    etc

I want to change this WS and WS-test interchagebly. For that i want to add this two into config and access what ever i want (WS or WS-test) by chaging the value in config. How to add this webservice references to config and access in code.

0

If I ask it another way..Can I inlcude 2 edmx files in the same project. I tried that but there are conflicts. Neither i can change the database structures nor other solution rather than accessing two databases in the same project. so what is the way?

0

I m using mvc4. I have urls like http://<mydomain>/<contoller0>/<action1> , http://<mydomain>/<contoller0>/<action2>,...
I want to show to the user only as http://<mydomain>/<contoller0>/{somepage} for all the actions in that particular controller.
How to impliment this in RouteConfig? I dont want to mess any requests to other controllers. Just want to do it for a specific controller and its actions.
How can I do it.

Currently my RoutConfig.cs look lik this.(It s the default)

routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{id}",
                defaults: new { id = RouteParameter.Optional }
            );

            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );
0

I am using sqlserver 2012. i want to convert nvarchar value from a table in to an integer. How can i do it? i am using it in a stored procedure. and nvarchar value only contains numbers.
What i want to do is to multiple that nvarchar value and assign it to int variable.. When i tried it Following error comes

Select @temp = @nvarcharvalue * 2

I also tried.

 Select @temp = CAST(@nvarcharvalue as int)* 2

Following error is shown.

The conversion of the nvarchar value '20130429044221' overflowed an int column.

How can it be done?
Thanks in advance

0

Thank you for the reply. I need the help on How to get two sessions in the database. I am working in my PC. I have insatalled SQLServer 2012 and management studio. I need to access a database as two different users to do this. How can i do it with my PC? or can i do it afterall?

I learnt that i need "two terminal sessions" and execute sql statements. How can I get that?

0

I am tryn a currency converter using hash table. What is the technique to use to enble covert both ways. Ex: Dollers to Euro and Euro to Dollers .

I can understand how to do it one way using currency as the hashKey and rate as Hashvalue. (I hope that is the correct way?).

How to do this. Please help. Thankx in advance.

0

I have a trigger on insert

    CREATE TRIGGER [dbo].[InsertNewCustomersAsGroupMembers]
    ON  [CustomerBase].[dbo].[Cutomers]
    AFTER INSERT
    AS 
    BEGIN

        SET NOCOUNT ON;

        -- Insert statements for trigger here
        DECLARE @inserterdCustomerID uniqueidentifier
        UPDATE [CustomerBase].[dbo].[GroupMembers]
        ?---?

    END
    GO

I want to get the values of the inserted record at [CustomerBase].[dbo].[customers] into the trigger inorder to update [CustomerBase].[dbo].[GroupMembers] table. How can i get them?

thank you in advance

0

I use Mvc 4 with razor. I have a View that in back end creates a database entry in Action method. Problem is when i refresh the page (Press F5) the back end method calls again and create duplicate of the database entry. How to stop this?

 public ActionResult SummaryPage()
 { 
    bool createdatabaseEntry = NotifyCreateDatabaseEntry();

   if (createdatabaseEntry)
    {
        // pop up success massage
    }
    else
    {
        // pop up error massage
    }

     return View();
 }

 public bool createdatabaseEntry : this method connect to the db

Please help
thank you in advance

0

quote is a mistake happened when copying code. Sorry for that

this is my partialview

<div class="body_txt width_640" style="margin-top: 20px; display: inline-block; float: left;">
        <br>
        <table style=" width:640px; border:0;"  cellspacing="0" cellpadding="0" class="table_shop01 body_txt">

            <tbody>
                <tr>
                    <th style=" width:60%; text-align: left;">Selected Items</th>
                    <th style=" width:40%; text-align: left; border-right:2px solid #759C12;">Unit Price</th>
                 </tr>

                @foreach (var item in Model.ListOfProducts)
                {
                    string k = @item.PriceListItemID.ToString();
                    <tr>
                        <td style="text-align: left; border-left:1px solid #759C12;">@item.ProductName</td>

                        <td style="text-align: left;">@item.Price.ToString() @item.CurrencySymbol</td>

                        <td style="text-align:left;">@item.TotalPrice @item.CurrencySymbol</td>*@
                        <td style="text-align: left; border-bottom:0;border-right:0;border-top:0; width:auto;">
                        <button type="button" class="btn_delete_2" id="@k" name="RemoveID" value="@item.PriceListItemID" style="display:none;"></button>

                        </td>
                    </tr>
                }
            </tbody>

            <tfoot>
                <tr>
                    <th id="total" colspan="1" style="text-align:left; border-right:2px;">Grand Total </th>
                    <td>@Model.GrandPrice.ToString()</td>
                </tr>
            </tfoot>
        </table>

</div>

here s how i am calling the partial view ..

 <div id="PartialView"></div>

   $(document).ready(function() {
        $('#PartialView').load('/contoller/_PartialView') ;

    });

Thank you.
Appreciate your kindly help.

p.s - this works fine in firefox and chrome only IE give the problem.

0

Thanks for the reply. In management studio if i try as a new query this works fine even with the "order by desc" applied. But when i put

declare IDList cursor for (SELECT ID FROM [dbo].[News] WHERE PublishFromDate BETWEEN cast(@fromDate  as datetime) AND cast(@toDate as datetime) order by PublishFromDate desc)

into the cursor it exectutes successfully but no results are given.