|
Hi ,
I just want a piece of code for appending a single column data base values of a table in a single string seperating by "," or "|".
|
|
|
|
|
Could you explain a little bit more what exactly you want to do? Giving an example will be better
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
fetch your code in datareader from the table
than loop throw the datareader and add the values in the string.
steps to do that
SqlConnection con = new SqlConnection("YOur connection string");
SqlCommand cmd = new SqlCommand(con,"Your query here");
con.Open();
DataReader dr = cmd.ExecuteNonQuery(); //confirm if this is the write function to call
string strValues = string.Empty;
while(dr.Read())
{
strValues += dr[0].ToString();
}
Note: There may be a bit of problem in this code.. i hope u can fix that.
|
|
|
|
|
Ask SQL question on SQl forum
Declare @result varchar(8000)
select @result = Coalesce (@results + ',', '') + columnName
from tableName
where condition
Alexei Rodriguez
|
|
|
|
|
Hey guys
Right now i am have this issue . Two person are updating a same record.
Is there a way to lock the record from being process? Right now i am using the method that once the record is loaded, it update the database record status field Lock to Y. The next person that load will check with database whether the Lock is N if is Y it cannot update. however if the user never update the record lock status Back to N once finish , this record cannot process by anyone else or view...
Any better solutions or idea?
Thanks bro
KaKaShi HaTaKe
|
|
|
|
|
|
we are setting few cookies in web application.when we try to access application using safari browser on Mac operating system,one of the cookies is not set. when we tried with another machine(Mac) safari browser, we are able to see cookie being created but it is not expiring as we set in code.we are not sure why this is happening with that particular cookie only. but other cookies are working as expected.we didn't get any issues with other browsers(IE and Firefox in windows)
Thank you in advance
|
|
|
|
|
i have attached exe file on asp.net page it was running well but when it was host to webserver it was creating problem.code given below:
System.Diagnostics.Process process1 = new System.Diagnostics.Process();
// Set the directory where the file resides
process1.StartInfo.WorkingDirectory = Request.MapPath("~/");
// Set the filename name of the file you want to open
process1.StartInfo.FileName = Request.MapPath("hard_disk_serialNo.exe");
// Start the process
process1.Start();
Thanks in Advance
|
|
|
|
|
You are doing this thing in asp.net. And page is rendered on user machine. So the path you are giving should be present on user machine. Then perhaps you can make it run. By using the above process you can run any exe resident on the server. But exe will not be visible to the user.
I wonder what you want to do.
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
Now that's just not true - asp.net runs the code on the server side, so this will always run this code on the server.
|
|
|
|
|
AhsanS wrote: So the path you are giving should be present on user machine. Then perhaps you can make it run
Wrong, as in very.
AhsanS wrote: Senior Software Engineer
|
|
|
|
|
You can do it using activeX components. But most of the browsers disabled it by default because of security reason. So your idea is useless.
|
|
|
|
|
You have a number of problems here:
1. No browser would ever let you just run an exe file, for security reasons.
2. Your code (in asp.net), running on the server, will attempt to run this executable on the server, in all cases which is not, i think, what you want.
If you really need to do this, you'll need to code an applet or an ActiveX control.
|
|
|
|
|
There's a way to do this but i might have taken a longer path
First of all the EXE must be present in the client's machine. Next, client's IP should be present in your server (which you can get from Request parameters).
Next, you would need to take input (or perform a lookup) for client's Windows username and password.
And next, you can launch a WMI Script or an equivalent WMI code using System.Diagonistics.Process to execute the process in the client's IP with that username and password.
-------------------------------------------
It's code that drives you - Shyam
|
|
|
|
|
Hi,
I m trying to set errormessage as oSrc.errormessage for validation control in javascript code it displays msg dynamically on alert but i want it on the ErrorMeaage of validator,as it shows the previous erreormessage and not giving new message.
|
|
|
|
|
Hi Coders
I add a aspx page of a webapplication to another. After addition I found the Ajax Tools(Update Panel) and Validation Controls(Required Field,Regular Exxpression) are not working.
Any help will be apprieciated.
Amit
|
|
|
|
|
Is ur other webapplication also Ajax Enabled?
|
|
|
|
|
Hi,
How to get the optional parameters values of the LDAP.
Hanumanth
|
|
|
|
|
hi
how to pass values from one page to the other page in post mechanism in ASP.NET i know how to pass val;ue by get mechanism in which we pass in query string and fetch through Request.GetQueryString["ValuePassedinQuerystring"], but how can we do it through post mechnism, i should be very thankful if any one can provide me the code snippet for it, thankx in advance,
regards,
|
|
|
|
|
If you dont want to put the values you are passing to the next page on the query string, then you may have to use save them in session
|
|
|
|
|
If you are using cross page posting, then you can find controls in previous page and get it's values. Assume you have a textbox in previous page with id as txt, value of this textbox can be taken by TextBox txt = (TextBox)Page.PreviousPage.FindControl("txt")
All posted values will be available in Request.Forms collection.
|
|
|
|
|
hi all,
I developed a Asp.net web application and it works well in my local system.When i hosted the same i am getting the error
"Login failed for user ''. The user is not associated with a trusted SQL Server connection. "
What exactly happened to the project ?Can anybody help me in solving the same.
Thanks in advance,
|
|
|
|
|
SQL Server (or Express) you deployed the database to is only enabled for Windows Authentication. You need to enable both SQL and Windows Authentication. You may also need to use SQL Server Surface Area Configuration to allow both local and remote connections - TCP/IP and named pipes
|
|
|
|
|
How can i achieve the mixed mode in authentication,in web config we are not able to set mode="mixed" right? i think only windows or forms authentication is allowed there
|
|
|
|
|
Thats because you need to make the authentication mode mixed on SQL Server, not your web app.
Bob
Ashfield Consultants Ltd
|
|
|
|