|
Could any one please help me out. Actually i want to insert values from two different text boxes into a single column of database as different rows in C#, it may be MySql or SQL Server Database. Currently what i am doing is i am inserting values like this
private void InsertRecord()
{
try
{
string strInsert = "insert into Quotation" +
"(JobNum, CompNameAdd)"
+ "values('" + this.txtJobNum.Text + "','"
+ this.txtCompNameAdd.Text + "')";
{
MySqlCommand command = new MySqlCommand(strInsert, Quotation.con);
Quotation.dQuotationAdapter.InsertCommand = command;
//Insert new record
Quotation.dQuotationAdapter.InsertCommand.ExecuteNonQuery();
MessageBox.Show("New Record Saved Successfully");
RefreshRecord();
ClearTextBoxes();
this.txtCompNameAdd.Focus();
}
In this type of code i can not insert values from two different text boxes into a single column of Database Table.
Please Help..
Imran
|
|
|
|
|
This will create one new row. To create a column, you need to insert two rows, into a table that only takes one value. Also, your code is a disaster on many levels, if I visit your website, I can delete your entire database, very easily. Read up on SQL injection attacks.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
how would i go about creating a creating a member page with the member name in the url. just like a myspace or youtube site,can some point me to some articles, or give me any ideas
|
|
|
|
|
If you want to get like yourname.yourwebsite.com then you probably need to search the article for creating the subdomain in ASP.NET..
|
|
|
|
|
Hi,
I have found lot of samples to convert a datagrid to Excel. But My problem is , if my datagrid contains hyperlinks, the resultant excel file will show the html source instead of the link. Could anyone tell me how to solve this issue...
Thanks in advance...
Sebastian
|
|
|
|
|
Hi,
lam displaying in repeater like single column output, but i need all the data's should be showing in 3 columns, no need of paging i need one "more.." command to view the rest of the data's. Can u pls help me..
krishna
|
|
|
|
|
A repeater is great for this, what you do is, you add your table rows/columns via a codebehind call that adds a new row on every third call. So, you initialise a variable to be 0, and you do calls for the top and bottom of each data item and then add one to that value. If that value %3 is 0, you return <tr><td> and </td></tr> otherwise you return the <td> </td> only.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
If I am having hundreds of pages in my application and the user given the provision for adding new roles and assigning roles allowed or denied for locations. Considering page level security then it would end up in creating hundreds of location tags in the web.config file. And each tag should contain all the roles either in the allow or deny attribute. Is this the normal way of establishing security in such an application? And writing to web.config restarts the application. After each modification or creation of a role we have to restart the application to make the updation take effect. Then what would be the best session state management policy considering the above scenario?
|
|
|
|
|
hi all
How can i get serial hard disk by asp.net(C#).
|
|
|
|
|
On the client machine ? You can't. No way.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
thanks
I get Serial on server !
|
|
|
|
|
Seems a strange thing to do, unless it's for server licensing.
public string GetVolumeSerial(string strDriveLetter)
{
if (strDriveLetter == "" || strDriveLetter == null) strDriveLetter = "C";
ManagementObject disk =
new ManagementObject("win32_logicaldisk.deviceid=\"" + strDriveLetter + ":\"");
disk.Get();
return disk["VolumeSerialNumber"].ToString();
}
using System.Management;
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
only you can get Serial of your Own HDD ..you can try with WMI
|
|
|
|
|
Dear Gurus,.
Would you please give me a snippet to get an URL from relative URL ? For example,
1] I have an URL like this : "~/abc/def.jpg".
2] My website application folder URL is, "http://www.myDomain.com/my_Application_folder".
3] So, I want to get the final URL for my jpg file as - "http://www.myDomain.com/my_Application_folder/abc/def.jpg".
4] Is it possible to get the application folder URL runtime without hardcoding.
Is there any class method avalable to get this full absolute URL from the relative url ? or any Snippet ? please..
Thanks and regards.
modified on Monday, January 07, 2008 3:41:21 PM
|
|
|
|
|
Please try to use this code.
Request.Url.AbsoluteUri
|
|
|
|
|
Hello all. So I have a SqlDataSource tag in an ASP page. Something like:
<asp:SqlDataSource ID="GridDataSource" runat="server" ConnectionString="..."
SelectCommand="selectStoreProcedure" SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:Parameter Name="Action" Type="String" Size="30" DefaultValue="GetFilteredEmployeeResources" />
<asp:Parameter Name='EmployeeId' Type='String' Size='10' DefaultValue="%" />
<asp:Parameter Name='EmployeeName' Type='String' Size='100' DefaultValue="%" />
<asp:Parameter Name='ResourceId' Type="Int32"/>
</SelectParameters>
</asp:SqlDataSource>
Now, in my code I use some user input to feed the select parameters, and I have something like:
GridDataSource.SelectParameters["EmployeeId"].DefaultValue =
txtIdEmpleado.Text.Length > 0 ? txtIdEmpleado.Text : "%";
...etc...
And then the stored procedure takes care of getting the information needed and filtered. Now, my fourth select parameter is an integer and thus I can't simply do a "like" in the sp's select query. So I made a workaround, and the 'flag' is whether or not this parameter is null.
So the question is: how can I set the parameter (programatically) to null? I tried something like:
GridDataSource.SelectParameters["ResourceId"].DefaultValue =
DBNull.Value.ToString();
but it's not working. Any idea on how can I accomplish this task?
Thanks in advance.
Stupidity is an International Association - Enrique Jardiel Poncela
|
|
|
|
|
Fernando A. Gomez F. wrote: it's not working. Any idea on how can I accomplish this task?
You want to pass the DbNull.Value to that parameter, right? You can try this code..
GridDataSource.SelectParameters["ResourceId"].Value = DBNull.Value;
|
|
|
|
|
Hai All,
i want a simple code in HTML Code to sent the searching query to google search. And get in a html page like odinary google
I used some code like this........
<form method="GET" action="http://www.google.com/search"><br />
<input type="text" name="q" size="32" maxlength="256" value="query string"><br />
<input type="submit" name="btnG" value="Google Search"><br />
<input type="hidden" name="site" value="default_collection"><br />
<input type="hidden" name="client" value="default_frontend"><br />
<input type="hidden" name="output" value="xml_no_dtd"><br />
<input type="hidden" name="proxystylesheet" value="default_frontend"><br />
</input></input></input></input></input></input></form>
But it is not working.
I want simple code in HTML or in ASP.Net that would work.
Please help for me.....
Thanks in Advance........
Senthil.S
Senthil S
Software Engineer
|
|
|
|
|
Can't you just build the google search URL ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
no that only i dont know to create.......
Senthil S
Software Engineer
|
|
|
|
|
Do you want to show the result in your website or in Google page?
If you want to show the result in Google, you can use the HTML. For example, if you look at <a href="http://michaelsync.net/">this site</a>[<a href="http://michaelsync.net/" target="_blank" title="New Window">^</a>], there is one search box. You can type the keyword that you want and click "Google Search" then it will show the result in Google page.
The code is like that below ~
<form target="_top" action="http://www.google.com/custom" method="get">
<table border="0" bgcolor="#ffffff">
<tbody><tr><td valign="top" nowrap="nowrap" height="32" align="left">
</td>
<td nowrap="nowrap">
<input type="hidden" value="michaelsync.net" name="domains" />
<label style="display: none;" for="sbi">Enter your search terms</label>
<input type="text" id="sbi" value="" maxlength="255" size="31" name="q" />
</td></tr>
<tr>
<td> </td>
<td nowrap="nowrap">
<table>
<tbody><tr>
<td>
<input type="radio" id="ss0" checked="" value="" name="sitesearch" />
<label title="Search the Web" for="ss0"><font size="-1" color="#000000">Web</font></label></td>
<td>
<input type="radio" id="ss1" value="michaelsync.net" name="sitesearch" />
<label title="Search michaelsync.net" for="ss1"><font size="-1" color="#000000">michaelsync.net</font></label></td>
</tr>
</tbody></table>
<label style="display: none;" for="sbb">Submit search form</label>
<input type="submit" id="sbb" value="Google Search" name="sa" />
<input type="hidden" value="pub-9763008045449359" name="client" />
<input type="hidden" value="1" name="forid" />
<input type="hidden" value="ISO-8859-1" name="ie" />
<input type="hidden" value="ISO-8859-1" name="oe" />
<input type="hidden" value="GALT:#008000;GL:1;DIV:#191919;VLC:663399;AH:center;BGC:EDF5FA;LBGC:EDF5FA;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1" name="cof" />
<input type="hidden" value="en" name="hl" />
</td></tr></tbody></table>
</form>
But if you want to show the result in your website, it can't be done without the server-side script. You have to download the Search API and register the account. then, you have to use that API in your website. If you want the example for that, you can search in Codeproject. there are a lot of article for that.
<div class="ForumSig"></div>
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
|
|
|
|
|
hai thanks for ur valuble response. It is exactly wat i want
Senthil S
Software Engineer
|
|
|
|
|
Aside from using iframe...is there a better way to integrate an asp.net website inside of a php and/or jsp webpage?
I've got asp.net website that operates as a standalone site. Now I have a business request to make that site seamlessly appear inside of the php or jsp website of our customer.
Thanks!
Andy
|
|
|
|
|
|
Hi,
I have a GridView control and a button on a page. Grid view contains a list of items. Button opens up a pop up for search item on click of it. In the popup the resulting items of the search results appear. I want to add the selected item from the search results to the datagrid of the parent window. I hope I have explained the scenario clearly with my bad english. What I need is, How can I add row to the datagrid control using javascript? or Is there any other way to implement the scenario?
Thank you for your help in advanced.
Nisha S.
|
|
|
|