|
"Input string was not in a correct format.Couldn't store <we> in ID Column. Expected type is Int64." error is coming in dtCompanyForm.Rows.Add(currentItemText); line
|
|
|
|
|
It is clear enough. You are trying to add string value to integer column.
|
|
|
|
|
Hi,
ya i have done.
in first listbox double click-->i created one more datatable for second list box and i added removed row from first listbox to that datatable and i binded that datatable to second listbox.
in second listbox double click event just i did in reverse.
anyway iam thankful to u r help
|
|
|
|
|
|
Ok
i will do like that.
thank you
|
|
|
|
|
try this:
public void MoveItems(ListControl lbName1, ListControl lbName2)
{
for (int i = 0; i < lbName1.Items.Count; i++)
{
if (lbName1.Items[i].Selected == true)
{
ListItem li = new ListItem();
li.Text = lbName1.SelectedItem.Text;
li.Value = lbName1.SelectedItem.Value;
lbName2.Items.Add(li);
lbName1.Items.Remove(li);
i--;
}
}
}
protected void firstlistbox_SelectedIndexChanged(object sender, EventArgs e)
{
MoveItems(firstlistbox, secondlistbox);
}
protected void secondlistbox_SelectedIndexChanged(object sender, EventArgs e)
{
MoveItems(secondlistbox, firstlistbox);
}
|
|
|
|
|
Hello Experts!!
i got above error in following code--->
mysdset = new DataSet();
DataColumn mycolumn = new DataColumn("Picture");
mycolumn.DataType = typeof(System.Byte[]);
mysdset.Tables[0].Columns.Add(mycolumn);
mysdset.Tables["tblImgData"].Rows[0]["Picture"] = GetImageData(s);
where string s = dr["Picture"].ToString();
I am fetching image from sql and displaying into crystal report.
|
|
|
|
|
Isn't the error message telling anything to you?
"Cannot find table 0"
Check out if mysdset is having any tables.
|
|
|
|
|
It shows table rows count 2.....
|
|
|
|
|
This just makes me want to cry. It tells me you don't know how to use a debugger, you don't know how to read and understand a simple error message, you can't use google, and yet you're trying to read images from a database. How is this possible ?
Your dataset is empty.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
instead of writing such lines please suggest me link for same or give answer to question,that helps me more.....
|
|
|
|
|
If you don't have the common sense to work out what to do based on having been told what is wrong, I'm not sure what else to say. Your dataset is empty. What do YOU think you should do ( apart from writing code that is more robust ) ? How about fixing your SQL ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
First add a DataTable to your dataset.
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
I assume his dataset is coming from a database, what he needs to do, is fix his SQL
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Where do you add a DataTable to you DataSet ? Nowhere; that's why you are getting a problem.
DataSet.Tables is a read-only property (as shown in the documentation[^]), so mysdset.Tables["tblImgData"].Rows[0]["Picture"] = GetImageData(s); would fail anyway.
I hope this clears things up a little:
DataTable dt = new DataTable("tblImgData");
dt.Columns.Add("Picture", typeof(Byte[]));
dt.Rows.Add(GetImageData(s));
DataSet ds = new DataSet("NewDataSetName");
ds.Tables.Add(dt); NOTE: I wrote this on the fly so it may not be syntactically correct.
If at first you don't succeed, you're not Chuck Norris.
|
|
|
|
|
|
how can i printing a (contorl of webform as well as data save)on submitbutton +asp.net with c# please help me
sudhir kumar
|
|
|
|
|
1. There is an ASP.Net forum.
2. There is a lot available on web related to this. See[^].
3. Have you tried anything?
modified on Saturday, June 27, 2009 3:09 AM
|
|
|
|
|
Following the instructions in Christophe Geers’ blog, based on an article by Pavel Zolnikov on CodeProject, I have created an IE Toolbar using C# in VS 2008.
When I run IE 7 (over Vista Home on a 64 bit laptop) and go View => Toolbars,
I see my toolbar listed (right along with the others, like the Google toolbar) but I cannot put a check mark beside my toolbar.
thanks for whatever help anyone can give me.
j2
|
|
|
|
|
hi...
my application needs the user to sign in (according to sql DB) before he start using the application
SqlConnection con1 = new SqlConnection("DATA SOURCE = MAX_TOSHIBA;Initial Catalog= nodule ; Integrated security = True");
SqlDataAdapter adp1 = new SqlDataAdapter();
SqlCommand com1 = new SqlCommand();
com1.CommandText = "SELECT * FROM user WHERE name=" + txt_username.Text + " ";
com1.Connection = con1;
adp1.SelectCommand = com1;
DataSet d1 = new DataSet();
adp1.Fill(d1);
then check the d1 if null or not
any way it give me an error at
adp1.Fill(d1);
the error
System.Data.SqlClient.SqlException was unhandled
Message="Incorrect syntax near the keyword 'user'."
another qustion do any one have a good demo for the data binding?
thanx 
|
|
|
|
|
Well, your code has a LOT of issues. The first one is that user is a keyword, so you need to put it in square brackets. select * from [user] where...
The next problem you have is that you're hard coding your connection in the same code as the SQL. Do you use the database anywhere else, at all ? Could you ever ? What if you change your data source, as you're bound to do ( or will every machine you ever deploy to be called 'MAX_TOSHIBA' ??? ). So, you need to factor this code out.
Your next issue is that, based on this code, I can start with your app, and either guarentee myself a login, or at least erase your database. You need to read on SQL injection attacks.
I assume this is not being written for your job, you're a long way from being able to write production quality code. If you're teaching yourself, I'd recommend buying some good books. If you're in a class, then I think you're being moved into learning SQL before you've been taught how to write half decent C#, but I assume it will all work out in the end.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
A_A wrote: com1.CommandText = "SELECT * FROM user WHERE name=" + txt_username.Text + " ";
if i am not correct, the user is a keyword used in SQL so change the column name ot use [user] and try again.
|
|
|
|
|
Why tell him exactly what I told him 30 min before ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
sorry, i din't refresh the page before giving the reply...
|
|
|
|
|
thank you both
but what if i change "user" to "user_1"
should I use "[user_1]"
thank in advance
|
|
|
|