how to save the textbox contents to sql server database

D

Dhananjay

hi everyone
i have a problem
how to save the textbox contents to sql server database.
i am getting this contents after conversion from web browser into
textbox(multiline)
I want to store all the contents of textbox in sql server database.
i ahve generated a table.
if u have any idea then let me know the coding for this in C#.net
 
R

Ryan S. Thiele

Well, I haven't worked with c#, but I may be able to help.

If you set the cell to text, you can save multiline strings. also, if you
set it to nvarchar(MaxNumberOfChars), you can also achieve this.

Are you using a dataset to work with the database, or are you using a more
direct approach?

--
Thiele Enterprises - The Power Is In Your Hands Now!

--
hi everyone
i have a problem
how to save the textbox contents to sql server database.
i am getting this contents after conversion from web browser into
textbox(multiline)
I want to store all the contents of textbox in sql server database.
i ahve generated a table.
if u have any idea then let me know the coding for this in C#.net
 
D

Dhananjay

Ryan said:
Well, I haven't worked with c#, but I may be able to help.

If you set the cell to text, you can save multiline strings. also, if you
set it to nvarchar(MaxNumberOfChars), you can also achieve this.

Are you using a dataset to work with the database, or are you using a more
direct approach?


I am using dataset .i have all the contrlos on a single win forms.
some toolstrip for open , new , save , showhtml , print.
some more like web browser, nad multiline textbox. thats it
i am unable to do it. can u help me to solve this.
its urgent plz.

Thanks in advance
Dhananjay
 
R

Ryan S. Thiele

You databind the textbox to the cell in the dataset.

of you can code it.

MyDataset.MyDatatable(rowindex).TextToSave = Textbox.text

Then just update the dataset.

VB2003:
MyDataset.Update(MyDataSet.MyDatatable)

VB2005:
MyDataTableAdapter.Update(MyDataset.MyDataTable)

Did this work? Or, is it what you wanted?
--
Thiele Enterprises - The Power Is In Your Hands Now!

--
Well, I haven't worked with c#, but I may be able to help.

If you set the cell to text, you can save multiline strings. also, if you
set it to nvarchar(MaxNumberOfChars), you can also achieve this.

Are you using a dataset to work with the database, or are you using a more
direct approach?


I am using dataset .i have all the contrlos on a single win forms.
some toolstrip for open , new , save , showhtml , print.
some more like web browser, nad multiline textbox. thats it
i am unable to do it. can u help me to solve this.
its urgent plz.

Thanks in advance
Dhananjay
 
R

Ryan S. Thiele

I converted it to C# for you:

MyDataset.MyDatatable(rowindex).TextToSave = Textbox.text;

--
Thiele Enterprises - The Power Is In Your Hands Now!

--
You databind the textbox to the cell in the dataset.

of you can code it.

MyDataset.MyDatatable(rowindex).TextToSave = Textbox.text

Then just update the dataset.

VB2003:
MyDataset.Update(MyDataSet.MyDatatable)

VB2005:
MyDataTableAdapter.Update(MyDataset.MyDataTable)

Did this work? Or, is it what you wanted?
--
Thiele Enterprises - The Power Is In Your Hands Now!

--
Well, I haven't worked with c#, but I may be able to help.

If you set the cell to text, you can save multiline strings. also, if you
set it to nvarchar(MaxNumberOfChars), you can also achieve this.

Are you using a dataset to work with the database, or are you using a more
direct approach?


I am using dataset .i have all the contrlos on a single win forms.
some toolstrip for open , new , save , showhtml , print.
some more like web browser, nad multiline textbox. thats it
i am unable to do it. can u help me to solve this.
its urgent plz.

Thanks in advance
Dhananjay
 
R

RobinS

People here may be able to help you, but if you really want
C# solutions, try posting your message in the C# newsgroup
microsoft.public.dotnet.languages.csharp instead of in a VB newgroup.

Robin S.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top