Posts

Upload and Display YouTube Video in Asp.Net

Image
In this tutorial I will teach you how to upload youtube video in database and display it in various style in web page in asp.net using C#. So, here we go... Make a database table with any name as you wish and give three column 1. ID which will be primary key and will auto increase. 2. UserID user name either from session or from simple inserting name every time when upload video. 3. VideoLink for storing video link from youtube page. YouTube video will not play on you web page until you convert it in embedded video so how to check which video is embedded and which one is not. look at the image   but when a user upload or share any youtube video he or she will not upload embedded video but he or she will upload simple URL of any video so we need to convert general URL in embedded URL by this way using C#. string s = TextBox1.Text string g = " embed/ ";         string o = " watch?v= ";       ...

Upload YouTube Video and On Video Click Display in Next Page (Similar to YouTube)

Image
if you are looking for to make a website similar to YouTube Then You are At right place. I will not tell yo to make complete web site like YouTube but will give some idea to solve particular problems like 1. How to upload YouTube Video 2. How to get Thumbnail of YouTube Video in your Database. 3. Onclick Display it in New page and Play there with some details. so here we go..... 1. how to upload video in Database.     you do not need to upload video to your database because your hosting company will not give huge data storage. So you should keep only link of that video when user upload this take link of that image. so I have link for you already above you can do it easily. Do not worry i will do it here this again. 1. First of all create a data base with some columns like this.   You do not need to make LikeCount and ViewCount because i have this for to collect like and hits on my site.Here we will store our data in server in those columns. In you Asp...

Problem While Inserting Data In SQL Server In Asp.Net

Today I faced a problem while inserting data in SQL Server. The problem was that when I Click on insert button then it insert some data values in another columns while assigned columns values was correct i.e. suppose i have two columns "Name" & "Address" then Address values goes to Name column and Address column is left blank. Every thing was correct in coding not even a single line was in mistake but still this was problem for me. If you face such type of problem when you are not using SQL Stored Procedure.  Then you should use SQL Stored Procedure to insert data value because this may be problem of server or any thing else. If any body has the same problem then share your experience. thank you 

Must Declear Scalar Variable in Asp.Net Problem

This problem is very common while inserting value in database of SQL. The reason behind this is that: 1. You do not declare your SQL variable in parameters like this SqlCommand cmd= New SqlCommand(" insert into table name (Name, RollNo) values(@Name, @ RollNo",Con); cmd.Parameters. AddwithValues (" Name ", TextBox1.Text);  cmd.Parameters. AddwithValues (" RollNo ", TextBox2.Text);    cmd.ExecuteNonQuery();  here you should include "@Name" and "@RollNo" with parameters 2. Second which I got is that we write cmd.ExecuteNonQuery(); above the parameter like this SqlCommand cmd= New SqlCommand(" insert into table name (Name, RollNo) values(@Name, @ RollNo",Con); cmd.ExecuteNonQuery(); cmd.Parameters. AddwithValues (" Name ", TextBox1.Text);  cmd.Parameters. AddwithValues (" RollNo ", TextBox2.Text);    This also shows Scalar variable problem. I hope this will help you a lot.  thank you   ...

How to Upload YouTube Video and Show it In DataListin Asp.net Using C#

Image
When you want to upload YouTube video in your server and want to display it in your web page then before this you will have to convert the YouTube link in embedded link because ifram tag of html supports this. How yo will get embedded YouTube video link. Look at the below picture. The selected text in the picture is embedded link of this video, you can get this by clicking on share text as this is obvious in picture. Since user will upload only URL got in web page you will have to convert it in embedded URL. How you will convert youtube url in embedded? if you are using C# then do link this.          string s = TextBox1.Text; // text box in which user enters Youtube URL         string g = "embed/";         string o = "watch?v=";         string m = s.Replace(o, g); // finally we get m as a embedded URL to store in database. With the hel...

Check User Name And Email Already Exist without Refreshing Page

Image
I this tutorial i will teach you how to check username and email ID if already registered or exist in database. It will be helpful for you when you will make a user registration page. So lets start 1. first take two text boxes and two labels make sure your labels do not contain any written text (It will appear unseen while loading page) 2. make a table in your database for testing purpose right now containing two columns named 'UserName' and 'Email ID'. 3. now select username text box( textbox1) and go to source. On the left side of toolbox there is Script manager drag and drop it on your page any where in body.   4. Now, Just below Script Manager there is Update Panel (as it is seen in image) now add your textbox in this panel but you will have to add another tag named Content Template it is also in coding as shown.  5. Now double click on TextBox1 which is related to User Name  and make Sql Connection and write code as shown here.   r...

Gridview Formating Tutorail for Beginers

Image
In Asp.Net gridview has its own importance because it bind same type of repeated data from server in bulk and give flexibility to programers. When I started working on gridview it was quite difficult for me to manage data in gridview because when you see other side arranging data in very stylish way and when you try to achieve it and do not succeeded in it, then it give you mental pain. But here i described some simple way to make it more understandable for you. So here we go. Suppose you want to make three columns in gridview and in one column want to set 'Tile' for your data i.e in one section Titles appear automatically. See in the above picture colored area represent different region of different data from database like Title, Description, Author Name, Date and video URL.    Do the following Steps: 1. Set The AutoGenerateColumns to Off.   It will allow you to manage your own columns in Grid View. Now you can see that there are two columns in the picture...