|
Then Just place True / false instead of Eval statement..
|
|
|
|
|
I have written this. theres is some problem. It shows "Convert.ToBoolean(true)".
What is the problem?
<asp:TemplateField HeaderText="Mode">
<ItemTemplate>
<asp:Button runat="server" Text="<%!Convert.ToBoolean(true) %>" CommandName="ToggleClick" CommandArgument=<%#true %>/>
</ItemTemplate>
</asp:TemplateField>
Thank You
|
|
|
|
|
No no.. write this...
<asp:TemplateField HeaderText="Mode">
<ItemTemplate>
<asp:Button runat="server" Text="True" CommandName="ToggleClick" CommandArgument="True" />
</ItemTemplate>
</asp:TemplateField>
In CommandArgument you need to specify what you want to pass to the event generated when button is clicked. I have placed true there, which is not required. Replace appropriate element there (I mean the field which might be dependent on the button)
|
|
|
|
|
Hi..,
i need to fire an event when double clicked on a listbox control.
|
|
|
|
|
|
currently i m using asp.net 2.0 with sqlserver 2000.
here two tables playing the role. Table "A" and "B". 5 records to be inserted into the "A". after 1st record inserted in "A", the autoid has to be used for the "B" table's column value.
Is it possible using TRANSACTION? (i m not using any store procedure or triggers......only simple insertion).. help me
- Karan
|
|
|
|
|
I do not really understand what you what. Do you mean something like this pseudo-code?
begin
start transansaction
insert into a (somevalues)
insert into b (select @@id from [last insert into a])
insert into a (somevalues)
insert into b (select @@id from [last insert into a])
insert into a (somevalues)
insert into b (select @@id from [last insert into a])
insert into a (somevalues)
insert into b (select @@id from [last insert into a])
insert into a (somevalues)
insert into b (select @@id from [last insert into a])
if(anyerror)
rollback()
else
commit()
end
Greetings
Covean
|
|
|
|
|
EXACTLY!! how can i achieve it? is it possible to fetch the autoid? since we using the transaction. so once all the process are ok, then only it will get commit.... help me.
|
|
|
|
|
|
At first to get the auto generated id your statement has to look like this.
(I'm working with SQL-Server 2005 and 2008, don't know if it works on older versions).
SET NOCOUNT ON; INSERT INTO tableName(ColumnA, ColumnB,...) VALUES(...); SELECT @@IDENTITY AS ID;
This statement turns the row counter off and selects after the insert the new generated id )instead of the row count). Now you can use ExecuteScalar to get the new generated id.
And to start an transaction look for example at the class OleDbTransaction its very easy to understand.
If have a little of time, but if you need I can post a little bit of source code for that.
Greetings
Covean
|
|
|
|
|
Hi All,
I have an ASP.Net web application. Users are able to access this application through internet as well as through intranet (LAN). My requirement is like this - The web page should show different welcome messages for Internet user and Intranet (LAN) user. Is there any way to do that in ASP.Net?
Thanks in Advance.
SoftwareDeveloper(.NET)
|
|
|
|
|
Why Dont You compare the ip address of yours and the clients ..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
Hi Sashidhar,
Thanks much for your quick reply. Let me please go in to more details of the requirement. You are right we can compare if the LAN access IP is one in the case. In our case we need to deploy the application to many client sites, there again the LAN ip would be different. We have thought about keeping a configuration in the table to identify the known ips and assuming all other requests are from internet..But intead of taking that way , would like to know any easiest or simple way in .Net to identify the request. I mean to distinguish it to LAN or internet. It would be nice to learn that information if we have any options. And If we get a confirmation that there is no direct way then can proceed in the alternate..
Thanks.
SoftwareDeveloper(.NET)
|
|
|
|
|
Siju-T wrote: In our case we need to deploy the application to many client sites,
We Can get the main Ip Address i.e.parent.So If You deploy any where, Asp.net can return the parent address so there is No problem where you deploy it.As long as it is deployed in their own productions..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
Ok..Suppose if we got the ip. From that how can find out the request came through internet or intranet. Hardcoding ip is not possible unfortunately per requirement. More over the module is a generalized module and will be used in many different applications and clients. if we need to hard code and track the ip for each client it would be little difficult..But that would be the last option..The important thing is not to take another way to reach the destination. It would be nice if we get an information that whether it is possible or not. I mean is there any method can find out the request is from internet or intranet. But if you can confirm that , the way is not possible to find out then we can take the other route. But really curious to know whether it is possible or not in .Net.
Thanks.
SoftwareDeveloper(.NET)
|
|
|
|
|
My Friend First Listen..!
You have an application which is deployed in host .i.e. In Your Company with parent Ip address.xxx.xxx.xxx.xxx
The People who are working in your company will have the same parentIp address.
So what is the problem in that.
Dont think too much..!
Its an easy One You can do it..!
all the best..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
Sashidar,
I am bit confused now..sorry I cannot pick your solution.
Here is my doubt.
Client machine send a request to the Server. In server how we can get the client's parent ip. Similarly it would be nice if you can share a code snippet or psuedocode etc.
Thanks.
SoftwareDeveloper(.NET)
|
|
|
|
|
You can get Many code snippets in google ..!
string ipAddress = Request.ServerVariables ["REMOTE_ADDR"];
string ipAddress2 = Request.UserHostAddress;
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
I m making cart dynamically in data table and at the cart view...........i m assigning this source to a
Data List..........and Want to update the quantity dynamically............how its possible.........& wht can be other way to do this task.........plz guide me a bit........
|
|
|
|
|
I'm sorry, this question is incomprehensible. What I think you're trying to do, seems trivial, but without seeing your code, I don't see how anyone can offer specific advice.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I have created my webapp in ASP.NET, C# and MS-Access.
in Table I have cell value as, 1 and 0. At the time of binding I want to convert it to On and Off respecively. How can I do it? Please help , as I am new to .NET
This is my code.
private void Binding()
{
// create the connection
OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:/GmoteDeviceControl/App_Data/DeviceCtrl.mdb;User Id=admin;Password=;");
// Open the connection
con.Open();
// create the DataSet
DataSet ds = new DataSet();
// create the adapter and fill the DataSet
OleDbDataAdapter da = new OleDbDataAdapter("Select DEVICE_NAME,CURRENT_STATE from SUBSCRIBER_DEVICES", con);
da.Fill(ds);
//Binding DataSource with GridView
GridView1.DataSource = ds.Tables[0];
GridView1.DataBind();
// close the connection
con.Close();
}
Thank You.
|
|
|
|
|
Purish Dwivedi wrote: Please help , as I am new to .NET
Then why are you writing data driven ASP.NET code ? That's at least three things you're trying to learn at once. Is it for school, or work ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Try Using RowDataBound event
|
|
|
|
|
|
thanks for the reply, but a new problem is,
that it is changing my column header also.
Any help would be appreciated.
Thank YOu
|
|
|
|