my column data is from 'nvarchar' type and the data for my text box is from string type. when i want to compare these value , the expression always is false . even when the values are equal. i use Convert.toInt32 for my column have dataType int but in this part i want compare two string type.
I would like to know, how to set up the Entity framework to create a nvarchar(50) insted of a nvarchar(4000), when creating a string? by the way I am not using the designer!
Does it make a difference in terms of the actual size of the database if I define one of the columns as nvarchar(100)? If there are restrictions on the form as for how much you can input, let's say 50 characters, does the db save blank spaces from character 51-100 and create a database that is larger than it would be it the column was defined as nvarchar(50)?
My datatable consists of a column named "ID". The no. of values in this column varies.Sometimes this Datatable fetches 3 IDs in that ID column, sometimes 2. Now if for example, my datatable has three values as 1,2,3. What I want is to put these three values in a string and separate them by commas as folows:-
string test= "1,2,3";
If Datatable has 2 values, then string should be as follows:-
string test= "1,2";
I did try but in vain.
edit:-
DataTable dt=new DataTable; dt = obj.GetIDs(); for (int i = 0; i < dt.Rows.Count; i++) { string test= "What should be here????"; } edit 2 foreach(DataRow dr in dt.Rows) { string str = str + "," + Convert.ToString(dr("ID")); }
@Rajeev ::Tried this..it says dr is a variable but used as a method. What's wrong?
I have a VS2010 project that I want to move back and forth between an x86 and an x64 machine. On the x86 machine, several assemblies are located in Program Files, and the path of the assemblies are shown as c:Program Files...... When I move this project to the x64 machine, the same assemblies are located in C:Program Files (x86).... Is there a way that I can confugure VS2010 so I don't have to manually change the path when I move the project from one machine to another?
how can in sql server show two columns as one column.. one of them is nvarchar and the other is int from two tables i have did this but it give error
select depart.depart_name+input_comp.no_of_depart as department,dbo.depart.depart_id from dbo.depart inner join dbo.input_comp on dbo.depart.depart_id=dbo.input_comp.depart_id group by depart.depart_name,dbo.depart.depart_id,input_comp.no_of_depart the depart_name is nvarchar datatypeand the no_of_depart is int datatype
the error is
Conversion failed when converting the nvarchar value to data type int.
I'm getting the following error base on dropdownlist selectindexchanged: error converting data type nvarchar to bigint
Below is my dropdownlist code:
Protected Sub ddlTaxName_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ddlTaxName.SelectedIndexChanged Dim strConnString As String = ConfigurationManager.ConnectionStrings("BytConnectionString").ConnectionString() Dim strQuery As String = "select TaxName, [Rate(%)] from Sale_Tax where" & " TaxID = @TaxID" Dim con As New SqlConnection(strConnString)
Company array is a string array where i have stored the company ids
the problem is company_array[0] has the initial value of the dropdownlist(company) --select company which is why m getting the error(cannot convert data type nvarchar to int) . I have used the same logic in many places in my project it did not give any error.
int count = 0; company_length = company_length - 1; while (count < GridView3.Rows.Count && compid_counter < company_length ) { cmd = new SqlCommand("insertWorkDetais", conn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@trainerId",trainerID);
Lets say I have a variable 'userid', I want to select from aspnet_Membership AND aspnet_AccountProfile tables. They both have the column userid, I just want to be able to make a statement like SELECT * FROM aspnet_AccountProfile, aspnet_Membership WHERE UserId=@UserId and it gets the records with the matching user id for BOTH tables. how do I do this?
I have a recruitment portal that people can use to advertise and search for jobs.I would like the recruiters to be able to add a small javascript snippet to their personal websites, that will list jobs on my site. how can i go about this?I have webservices set up so the javascript can just call that, but i also need the result to be formatted and placed inline.This should work in a simular way to google adsense.
I have 1,2,3,4,5,6,7,8,9 stored as nvarchar inside Level in my db.
I then have a dropdownlist with values 1,2,3,4,5,6,7,8,9. When a user makes a selection (i.e 1) (Level.SelectedValue.ToString). This builds an sql query via a param like this:
"Select things From MBA_EOI Where level = 1"
When I run the select I get the following error:
Syntax error converting the nvarchar value '1,2,3,4,5,6,7,8,9' to a column of data type int.
I was under the impression that I was dealing with an Nvarchar field and the selected value as string, where does the int conversion come in?
when i am trying to uedit my recods in gridview this error is coming. I am using SQLDatasource with gridview and for edit purpose i am using stored procedure. I have manually executed the SP and its woring fine. my SP is here
I am trying to pull data from my populated javascript table. How do I pull the value from a javascript row? I am using
for (var i = 0; i < rowCount; i++) { var row = table.rows[i]; //This is where I am having trouble var chkboxIndicator = row.cells[0].childNodes[1]; alert(chkboxIndicator); // if (chkboxIndicator == indicator && Checkbox.checked == false) { table.deleteRow(i); rowCount--; i--; } }
which has an alert message of "undefined". I tried .value and .text as well and no progress. How do I get the text from the childNodes?
I am currently developing a web site for our Student Council so members can check in and view the work they've done, sign up for tasks, etc. They will authenticate using their username provided by the school district's AD servers. How can I make it so that only their data shows up when they use their username?