ASP.NET C# storing Session in DataBase : <p>i am new with ASP.NET and C#. I was trying to store details of a booking into the booking table including User ID using the session.
My booking table is as follow</p>

<pre><code>CREATE TABLE [dbo].[BookingTb] (
[Bid]       INT          IDENTITY (1, 1) NOT NULL,
[Rid]       VARCHAR (5)  NOT NULL,
[Price]     MONEY        NOT NULL,
[nights]    INT          NOT NULL,
[NoOfRooms] INT          NOT NULL,
[Uid] VARCHAR(50) NOT NULL, 
PRIMARY KEY CLUSTERED ([Bid] ASC));
</code></pre>

<p>and the user table is as follow</p>

<pre><code>CREATE TABLE [dbo].[UserTb] (
[Uid]      VARCHAR (50) NOT NULL,
[Uname]    VARCHAR (15) NOT NULL,
[Ubd]      INT          NOT NULL,
[Ugender]  VARCHAR (10) NOT NULL,
[Uemail]   VARCHAR (50) NOT NULL,
[password] VARCHAR (50) NOT NULL,
PRIMARY KEY CLUSTERED ([Uid] ASC));
</code></pre>

<p>i created the session in the login form as follow</p>

<pre><code>Session["Uid"] = TextBox1.Text.ToString();
</code></pre>

<p>Now i want to store different details in the Booking table including the session after the user log in so i used the following code:</p>

<pre><code>using System.Data;
using System.Data.SqlClient;
public partial class UserBooking : System.Web.UI.Page
{
    DataClassesDataContext db = new DataClassesDataContext();
    protected void Button1_Click(object sender, EventArgs e)
    {
        BookingTb b = new BookingTb();
        Int32 rooms,nights, cap,price;
        rooms = Convert.ToInt32(TextBox1.Text);
        nights = Convert.ToInt32(TextBox2.Text);
        cap = Convert.ToInt32(DropDownList2.SelectedItem.Value);
        String type = DropDownList1.SelectedItem.Value;
        String Rid;
        String user =Convert.ToString(Session["Uid"]) ;

        if (type == "Normal" &amp;&amp; cap == 2)
        { 
            Rid = "G01";
            price = rooms * nights * 35;
          b.Rid = Rid;
            b.Price = price;
            b.nights = nights;
            b.Uid = user;
            b.NoOfRooms = rooms;
            db.BookingTbs.InsertOnSubmit(b);
            db.SubmitChanges();
            Label3.Text = "Thank you for Booking with us!&lt;/br&gt; Total Payment= " + price;
        }
</code></pre>

<p>the problem is i keep getting this error:</p>

<pre><code>    Line 39:b.Uid = user;
Compiler Error Message: CS0029: Cannot implicitly convert type 'string' to 'int'
</code></pre>

<p>well, Uid is a varchar(50) not an int! how can i solve that? i tried many ways but non of them worked.</p>
