如何使用Jquery在Json中传递字符串。 [英] How Can I Pass String In Json Using Jquery.

查看:71
本文介绍了如何使用Jquery在Json中传递字符串。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HEllo团队,



我编写的代码如下:

HEllo Team,

I have written the code as follows:

qcAllocationDetails.BatchId = $("#batchIDSelect option:selected").map(function () {
               return $(this).val();
           }).get().join(',');







由于BatchId数据类型为Integer。我得到的值为1,2。

我想在字符串中传递这个值,这样它就不会给我错误(无法将整数转换为String)。无论如何都要通过我写的代码中的字符串中的整数值。我不想更改batchid的数据类型。无论如何还是有任何代码可以帮助我。



请指导我。

谢谢

harshal




As the BatchId datatype is Integer. I am getting the value as 1,2.
I want to pass this value in string,so that it will not give me error (could not convert integer to String).Is there anyway to pass the integer value in string in the code which i have written .I dont want to change the data type for batchid.Is there anyway or any code which help me.

Please guide me.
Thanks
harshal

推荐答案

#batchIDSelect选项:选中)。map(function(){
return
("#batchIDSelect option:selected").map(function () { return


this )。val();
})。 get ()。 join ' ,');
(this).val(); }).get().join(',');







由于BatchId数据类型为Integer。我得到的值为1,2。

我想在字符串中传递这个值,这样它就不会给我错误(无法将整数转换为String)。无论如何都要通过我写的代码中的字符串中的整数值。我不想更改batchid的数据类型。无论如何还是有任何代码可以帮助我。



请指导我。

谢谢

harshal




As the BatchId datatype is Integer. I am getting the value as 1,2.
I want to pass this value in string,so that it will not give me error (could not convert integer to String).Is there anyway to pass the integer value in string in the code which i have written .I dont want to change the data type for batchid.Is there anyway or any code which help me.

Please guide me.
Thanks
harshal


我得到了我的错误。

在我的实体中我只是将BatchId int的数据类型更改为String,而不是在Sql中。



谢谢

Harshal
i get My Mistake.
In My Entity i just change the Datatype of BatchId int to String,Not in Sql.

Thanks
Harshal


这篇关于如何使用Jquery在Json中传递字符串。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆