Showing posts with label insert. Show all posts
Showing posts with label insert. Show all posts

Saturday, March 31, 2012

SendKeys In A Webform

I have a button to insert text into a field, after inserting the text i would like to set the cursor at the end of that text to then complete the entry
I can set the text and the focus
txtNewPrice.Text ="$"
txtNewPrice.Focus()

But how can i use the send keys to move to the end of that text
In a Windows world i would do this but i dont seem to have that function in the web world
SendKeys.Send("{END}")

you can try using javascript for that


Could you give me an example


Hi

I needed something similar this weekend. Found this and it works fine.

http://www.velocityreviews.com/forums/t70952-set-focus-and-cursor-at-end-of-text.html

Separate by comma

Hi,

I have a datalist on my page to select data from a table

I want to access it with code to insert its values to another table. Te datalist will return more than one row, so i'd like the values seperated by commas when they are inserted to the new table (all in one row).

I have looked around and it seems that I need to do something to the select statement of the other control first - I have got:

SELECT [Usersname]= COALESCE (Usersname + ' , ' , ' ')
FROM [Transactions] WHERE ([Itemid] = @dotnet.itags.org.Itemid)

Does that look right?

And when I have selected these values, how do I insert them in the same format (separated by commas) ?:

DataView dv = SqlDataSource2.Select(DataSourceSelectArguments.Empty) as DataView;
string receivername = dv[0]["receivername"].ToString();
command.Parameters.AddWithValue("@dotnet.itags.org.recievername", receivername);

Would that still work?

Thanks,

Jon

pls help!!


You can pass the value (comma separated value) to a stored procedure as a parameter.

Within the procedure you can insert the data into the table. Before inserting the data into the table we have to split it by comma and then we have to place in a temporary table.

Now we have to extract the data from temp table to actual table.

There is a function called "split" is available to split the data and it will return the data as a table. You can use the same function to insert into your table.

You can get this function at of this URL:http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=50648

http://vadivel.blogspot.com/2006/05/split-function-in-sql-server-method-1.html

Hope this helps you.

Separate data by comma

Hi,

I have a datalist on my page and I want to access it with code to insert its values, seperated by commas.

I have looked around and it seems that I need to do something to the select statement of the other control first - I have got:

SELECT [Usersname]= COALESCE (Usersname + ' , ' , ' ')
FROM [Transactions] WHERE ([Itemid] = @dotnet.itags.org.Itemid)

Does that look right?

And when I have selected these values, how do I insert them in the same format (separated by commas) ?:

DataView dv = SqlDataSource2.Select(DataSourceSelectArguments.Empty) as DataView;
string receivername = dv[0]["receivername"].ToString();
command.Parameters.AddWithValue("@dotnet.itags.org.recievername", receivername);

Would that still work?

Thanks,

Jon

pls help!


If I m not wrong, I understand from your question that you need to enter multiple rows in database.

You can refer

http://zirmandli.wordpress.com/2007/09/22/data-access-application-block-gets-batch-update-functionality-in-enterprise-library-30/

I hope this will help u....


Hi,

No, I didnt explain well enough. I will repost.

Thanks anyway

Jon